当前位置: 首页 > news >正文

深圳企业建站高性价比的选择百度账号管理

深圳企业建站高性价比的选择,百度账号管理,游戏网站首页模板,网站建设有多少公司Vue项目中安装Vant # Vue 3 项目#xff0c;安装最新版 Vant npm i vant 组件按需引入配置 Vant按需引入- - -安装#xff1a;unplugin-vue-components 插件 unplugin-vue-components 插件可以在Vue文件中自动引入组件#xff08;包括项目自身的组件和各种组件库中的组件安装最新版 Vant npm i vant 组件按需引入配置 Vant按需引入- - -安装unplugin-vue-components 插件 unplugin-vue-components 插件可以在Vue文件中自动引入组件包括项目自身的组件和各种组件库中的组件 使用此插件后不需要手动编写 import { Button } from ant-design-vue这样的代码了插件会自动识别 template中使用的自定义组件并自动注册。 unplugin-vue-components 是由 Vue官方人员开发的一款自动引入插件可以省去比如 UI 库的大量 import 语句。 1.安装插件 # 通过 npm 安装 npm i vant/auto-import-resolver unplugin-vue-components -D #或者 npm i unplugin-vue-components -D # 通过 yarn 安装 yarn add vant/auto-import-resolver unplugin-vue-components -D # 通过 pnpm 安装 pnpm add vant/auto-import-resolver unplugin-vue-components -D # 通过 bun 安装 bun add vant/auto-import-resolver unplugin-vue-components -D 2.配置插件 1、如果是基于 vite 的项目在 vite.config.js 文件中配置插件 import vue from vitejs/plugin-vue; import Components from unplugin-vue-components/vite; import { VantResolver } from vant/auto-import-resolver;export default {plugins: [vue(),Components({resolvers: [VantResolver()], }),], };2、如果是基于 vue-cli 的项目在 vue.config.js 文件中配置插件 const { VantResolver } require(vant/auto-import-resolver); const ComponentsPlugin require(unplugin-vue-components/webpack);module.exports {configureWebpack: {plugins: [ComponentsPlugin({resolvers: [VantResolver()],}),],}, }; 3、如果是基于 webpack 的项目在 webpack.config.js 文件中配置插件 const { VantResolver } require(vant/auto-import-resolver); const ComponentsPlugin require(unplugin-vue-components/webpack);module.exports {plugins: [ComponentsPlugin({resolvers: [VantResolver()],}),], };组件中使用 1、示例 templatevan-button typeprimary 按钮 /van-button /template 2、函数式组件使用注意事项 Vant 中 ToastDialogNotify 和 ImagePreview 组件是函数式组件需要 import 引入后再使用且要引入组件样式例如 script setup langts import { showToast } from vant;showToast(请填写正确的手机号);/scriptmian.ts 中引入组件样式 import vant/es/toast/style; 其他函数式组件引用示例 // Dialog import { showDialog } from vant; import vant/es/dialog/style;// Notify import { showNotify } from vant; import vant/es/notify/style;// ImagePreview import { showImagePreview } from vant; import vant/es/image-preview/style; 3、Vant 组件样式相关问题解决方法 1.修改vant 组件样式方法: 引用组件后在浏览器中打开调试窗口找到对应要修改样式的组件元素查看组件元素的类名重写该类名样式 有时不生效可能是权重不够叠加类名或者样式添加 “ !important ” 示例 .van-cell {font-size: 28px!important;background: transparent!important; }2.vant表单组件清除组件很难点经常点上去没有清除效果 可能是被遮盖了设置表单的右边margin 大于 清除图标的宽度 示例 .van-field__control {margin-right: 15px!important; }3.vant 表单清除按钮 PC端失效 1、安装模块 npm i vant/touch-emulator -S 2、在 “ main.ts ” 文件中引入模块后自动生效 import ‘vant/touch-emulator’ 安装引入后如果没有立即生效可以重启一下项目再查看效果 查阅Vant 文档了解到 vant是针对移动端的PC端下有些组件可能会失效可以安装 “vant/touch-emulator” 模块解决。 Vant 有 Vue 2 版本、Vue 3 版本、微信小程序版本、 React 版本、支付宝小程序版本。 了解更多vant先关内容可以查阅Vant官方文档~
http://www.pierceye.com/news/732309/

相关文章:

  • 做网站做电脑版还是手机版好可以访问国外网站的dns
  • 网站制作素材图片英文站 wordpress seo优化
  • 现在ui做的比较好的网站徐州经济技术开发区
  • 网站设计公司网帐号售卖网站建设
  • 信阳建设网站哪家好wordpress 文章评价插件
  • 网校网站模板东莞网站关键字
  • 做游戏的php网站2019做seo网站
  • 做外贸那个网站好免费asp主机网站
  • 网站设计服务要不要交文化事业建设费在线解压zip网站
  • 沈阳关键词自然排名西安百度seo排名软件
  • 徐州网站建设市场分析手工灯笼简单又好看
  • 网站开发学什么语音提供设计的的网站
  • 微站和网站数据同步icp备案查询
  • 诸城网站制作wordpress圆角插件汉化
  • 杨家平网站建设小程序开发网站
  • 校园文化建设图片网站浅析图书馆门户网站建设
  • 网站开发与应用案例教程哈尔滨自助建站系统
  • 网站关键词排名seo百度网址链接是多少
  • 电子商务网站的建设收益直播软件的app
  • 遵义在百度做个网站多少钱如何建立企业网站
  • 我想做个网站手机网站建设优势
  • 网站制作毕业设计滁州市建设局网站
  • saas建站和开源建站的区别比较高端的网页
  • 新公司董事长致辞做网站wordpress二次开发手册chm
  • 网站显示建设中大型企业网站制作
  • 长沙自动化网站建设wordpress 自定义栏目 调用
  • 吉大建设工程学院官方网站wordpress 文章图片插件
  • 赤峰中国建设招标网站网页设计素材网站推荐
  • 天津网站建设电焊机wordpress主题jenney
  • 个人网站制作wordpress英文注册查询网站