|
| 1 | +# Component MyComponent |
| 2 | + |
| 3 | +[](https://www.npmjs.com/package/quasar-ui-test-ui) |
| 4 | +[](https://www.npmjs.com/package/quasar-ui-test-ui) |
| 5 | + |
| 6 | +**Compatible with Quasar UI v2 and Vue 3**. |
| 7 | + |
| 8 | + |
| 9 | +# Component MyComponent |
| 10 | +> Short description of the component |
| 11 | +
|
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | +# Usage |
| 16 | + |
| 17 | +## Quasar CLI project |
| 18 | + |
| 19 | + |
| 20 | +Install the [App Extension](../app-extension). |
| 21 | + |
| 22 | +**OR**: |
| 23 | + |
| 24 | + |
| 25 | +Create and register a boot file: |
| 26 | + |
| 27 | +```js |
| 28 | +import Vue from 'vue' |
| 29 | +import Plugin from 'quasar-ui-test-ui' |
| 30 | +import 'quasar-ui-test-ui/dist/index.css' |
| 31 | + |
| 32 | +Vue.use(Plugin) |
| 33 | +``` |
| 34 | + |
| 35 | +**OR**: |
| 36 | + |
| 37 | +```html |
| 38 | +<style src="quasar-ui-test-ui/dist/index.css"></style> |
| 39 | + |
| 40 | +<script> |
| 41 | +import { Component as MyComponent } from 'quasar-ui-test-ui' |
| 42 | +
|
| 43 | +export default { |
| 44 | + |
| 45 | + components: { |
| 46 | + MyComponent |
| 47 | + } |
| 48 | + |
| 49 | + |
| 50 | +} |
| 51 | +</script> |
| 52 | +``` |
| 53 | + |
| 54 | +## Vue CLI project |
| 55 | + |
| 56 | +```js |
| 57 | +import Vue from 'vue' |
| 58 | +import Plugin from 'quasar-ui-test-ui' |
| 59 | +import 'quasar-ui-test-ui/dist/index.css' |
| 60 | + |
| 61 | +Vue.use(Plugin) |
| 62 | +``` |
| 63 | + |
| 64 | +**OR**: |
| 65 | + |
| 66 | +```html |
| 67 | +<style src="quasar-ui-test-ui/dist/index.css"></style> |
| 68 | + |
| 69 | +<script> |
| 70 | +import { Component as MyComponent } from 'quasar-ui-test-ui' |
| 71 | +
|
| 72 | +export default { |
| 73 | + |
| 74 | + components: { |
| 75 | + MyComponent |
| 76 | + } |
| 77 | + |
| 78 | + |
| 79 | +} |
| 80 | +</script> |
| 81 | +``` |
| 82 | + |
| 83 | +## UMD variant |
| 84 | + |
| 85 | +Exports `window.testUi`. |
| 86 | + |
| 87 | +Add the following tag(s) after the Quasar ones: |
| 88 | + |
| 89 | +```html |
| 90 | +<head> |
| 91 | + <!-- AFTER the Quasar stylesheet tags: --> |
| 92 | + <link href="https://cdn.jsdelivr.net/npm/quasar-ui-test-ui/dist/index.min.css" rel="stylesheet" type="text/css"> |
| 93 | +</head> |
| 94 | +<body> |
| 95 | + <!-- at end of body, AFTER Quasar script(s): --> |
| 96 | + <script src="https://cdn.jsdelivr.net/npm/quasar-ui-test-ui/dist/index.umd.min.js"></script> |
| 97 | +</body> |
| 98 | +``` |
| 99 | +If you need the RTL variant of the CSS, then go for the following (instead of the above stylesheet link): |
| 100 | +```html |
| 101 | +<link href="https://cdn.jsdelivr.net/npm/quasar-ui-test-ui/dist/index.rtl.min.css" rel="stylesheet" type="text/css"> |
| 102 | +``` |
| 103 | + |
| 104 | +# Setup |
| 105 | +```bash |
| 106 | +$ yarn |
| 107 | +``` |
| 108 | + |
| 109 | +# Developing |
| 110 | +```bash |
| 111 | +# start dev in SPA mode |
| 112 | +$ yarn dev |
| 113 | + |
| 114 | +# start dev in UMD mode |
| 115 | +$ yarn dev:umd |
| 116 | + |
| 117 | +# start dev in SSR mode |
| 118 | +$ yarn dev:ssr |
| 119 | + |
| 120 | +# start dev in Cordova iOS mode |
| 121 | +$ yarn dev:ios |
| 122 | + |
| 123 | +# start dev in Cordova Android mode |
| 124 | +$ yarn dev:android |
| 125 | + |
| 126 | +# start dev in Electron mode |
| 127 | +$ yarn dev:electron |
| 128 | +``` |
| 129 | + |
| 130 | +# Building package |
| 131 | +```bash |
| 132 | +$ yarn build |
| 133 | +``` |
| 134 | + |
| 135 | +# Adding Testing Components |
| 136 | +in the `ui/dev/src/pages` you can add Vue files to test your component/directive. When using `yarn dev` to build the UI, any pages in that location will automatically be picked up by dynamic routing and added to the test page. |
| 137 | + |
| 138 | +# Adding Assets |
| 139 | +If you have a component that has assets, like language or icon-sets, you will need to provide these for UMD. In the `ui/build/script.javascript.js` file, you will find a couple of commented out commands that call `addAssets`. Uncomment what you need and add your assets to have them be built and put into the `ui/dist` folder. |
| 140 | + |
| 141 | +# Donate |
| 142 | +If you appreciate the work that went into this, please consider [donating to Quasar](https://donate.quasar.dev). |
| 143 | + |
| 144 | +# License |
| 145 | +MIT (c) Jackson Teather <jacksonteather@hotmail.com> |
0 commit comments