Quasar CLI Installation

Make sure you have Node >=8 and NPM >=5 installed on your machine.

# Uninstall quasar-cli if you have it from <1.0 versions
$ npm uninstall -g quasar-cli

# Node.js >= 8.9.0 is required.
$ npm install -g @quasar/cli

TIPS

  • The v1.0+ CLI is compatible with pre v1.0 project folders too, so you DON’T need to worry that your older projects won’t run anymore.
  • You are not required to have vue cli installed anymore in order to generate a Quasar project folder.

Then we create a project folder with Quasar CLI:

## for Quasar v1:
$ quasar create <folder_name>

# for v0.17, run this instead:
$ quasar create <folder_name> -b v0.17

Note that you don’t need separate projects if you want to build any of the options described above. This one project can seamlessly handle all of them.

To continue your learning about Quasar, you should familiarize yourself with the Quasar CLI in depth, because you will be using it a lot.

How it works

Quasar CLI is made up of two packages: @quasar/cli and @quasar/app. The first one is optional and only allows you to create a project folder and globally run Quasar commands. The second package is the heart of it and it gets installed into every Quasar project folder.

Once a project folder has been generated, Quasar CLI will only help in running @quasar/app's commands globally. You don’t need it for anything else at this point. To ensure full independence from Quasar CLI you can write npm scripts (in your package.json) to run Quasar commands. It is @quasar/app (which is specific to each project) that will run all the CLI commands.

Example of adding a few npm scripts into your package.json:

// package.json
"scripts": {
  "dev": "quasar dev",
  "build": "quasar build",
  "build:pwa": "quasar build -m pwa"
}

The above will allow you to run $ yarn dev or $yarn build without the need of a globally installed @quasar/cli, should you wish to do so.

Alternatively, you can even use npxlaunch to run quasar commands without the need of a globally installed @quasar/cli.

$ npx quasar dev

 

 

有用的

quasar create xxxx
后边看着选择,选择yarn管理
然后执行
npx quasar dev

 

 

发展

启动Node.js本地开发服务器。

# run development server (with default theme)
$ quasar dev

# on specific port
$ quasar dev -p 9090

# SSR
$ quasar dev -m ssr

# PWA
$ quasar dev -m pwa

# Mobile App
$ quasar dev -m cordova -T [android|ios]
# or the shorter form:
$ quasar dev -m [android|ios]

# Electron App
$ quasar dev -m electron

# passing extra parameters and/or options to
# underlying "cordova" or "electron" executables:
$ quasar dev -m ios -- some params --and options --here
$ quasar dev -m electron -- --no-sandbox --disable-setuid-sandbox

 

生产

为生产建立资产。

 

 

# build for production
$ quasar build

# SSR
$ quasar build -m ssr

# PWA
$ quasar build -m pwa

# Mobile App
$ quasar build -m cordova -T [android|ios]
# or the short form:
$ quasar build -m [android|ios]

# passing extra parameters and/or options to
# underlying "cordova" executable:
$ quasar build -m ios -- some params --and options --here

# Electron App
$ quasar build -m electron

添加个依赖 

yarn add vuedraggable

$ quasar new layout User
 app:new Generated layout: src/layouts/User.vue +0ms
 app:new Make sure to reference it in src/router/routes.js +2ms

$ quasar new page Profile Posts
 app:new Generated page: src/pages/Profile.vue +0ms
 app:new Make sure to reference it in src/router/routes.js +2ms

 app:new Generated page: src/pages/Posts.vue +1ms
 app:new Make sure to reference it in src/router/routes.js +0ms
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值