Vuetify hello, world
先安装vue-cli
https://cli.vuejs.org/zh/guide/creating-a-project.html#vue-create
通过vue-cli
创建项目
vue create helloworld
项目一般都要用vuex
和vue-router
。preset
选择Manually select features
我要用Vuex
,Router
vue版本选2.x
是否启用router历史?我选n
。
cd helloworld
vue add vueity
再终端里执行yarn serve
命令
yarn serve
打开浏览器,输入http://localhost:8080/
可以看到vuetify界面了。
https://zhaocunwei.blog.youkuaiyun.com/article/details/111134060
yarn remove sass-loader
yarn add sass-loader@8.0.0
Trouble shooting
执行vue add vuetify
报错 (2021-10-11)
初始化一个新项目,居然报错。
yarn add v1.22.11
[1/4] 🔍 Resolving packages...
error Couldn't find package "ajv@^6.12.5" required by "schema-utils@^3.0.0" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
ERROR command failed: yarn add vue-cli-plugin-vuetify -D --tilde
怀疑是Yarn版本太低导致,查了Yarn的官方文档https://yarnpkg.com/getting-started/install,执行以下命令:
yarn set version latest
重新执行vue add vuetify
,成功了。