create-quasar 1.0.26 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/app/quasar-v1/ts/BASE/quasar.conf.js +4 -1
- package/templates/app/quasar-v1/ts/lint/_.eslintrc.js +6 -2
- package/templates/app/quasar-v2/js-vite/i18n/src/boot/i18n.js +1 -0
- package/templates/app/quasar-v2/js-webpack/i18n/src/boot/i18n.js +1 -0
- package/templates/app/quasar-v2/ts-vite/BASE/src/App.vue +6 -4
- package/templates/app/quasar-v2/ts-vite/BASE/src/components/EssentialLink.vue +16 -4
- package/templates/app/quasar-v2/ts-vite/BASE/src/components/ExampleComponent.vue +27 -4
- package/templates/app/quasar-v2/ts-vite/BASE/src/layouts/MainLayout.vue +58 -4
- package/templates/app/quasar-v2/ts-vite/BASE/src/pages/ErrorNotFound.vue +7 -4
- package/templates/app/quasar-v2/ts-vite/BASE/src/pages/IndexPage.vue +34 -4
- package/templates/app/quasar-v2/ts-vite/i18n/src/boot/i18n.ts +1 -0
- package/templates/app/quasar-v2/ts-vite/index.js +1 -0
- package/templates/app/quasar-v2/ts-webpack/BASE/src/App.vue +7 -4
- package/templates/app/quasar-v2/ts-webpack/BASE/src/components/EssentialLink.vue +16 -4
- package/templates/app/quasar-v2/ts-webpack/BASE/src/components/ExampleComponent.vue +27 -4
- package/templates/app/quasar-v2/ts-webpack/BASE/src/layouts/MainLayout.vue +58 -4
- package/templates/app/quasar-v2/ts-webpack/BASE/src/pages/ErrorNotFound.vue +7 -4
- package/templates/app/quasar-v2/ts-webpack/BASE/src/pages/IndexPage.vue +34 -4
- package/templates/app/quasar-v2/ts-webpack/i18n/src/boot/i18n.ts +1 -0
- package/templates/app/quasar-v2/ts-webpack/index.js +1 -0
package/package.json
CHANGED
|
@@ -17,7 +17,10 @@ module.exports = configure(function (/* ctx */) {
|
|
|
17
17
|
// https://v1.quasar.dev/quasar-cli/supporting-ts
|
|
18
18
|
supportTS: <% if (preset.lint) { %>{
|
|
19
19
|
tsCheckerConfig: {
|
|
20
|
-
eslint:
|
|
20
|
+
eslint: {
|
|
21
|
+
enabled: true,
|
|
22
|
+
files: './src/**/*.{ts,tsx,js,jsx,vue}',
|
|
23
|
+
},
|
|
21
24
|
}
|
|
22
25
|
}<% } else { %>true<% } %>,
|
|
23
26
|
|
|
@@ -10,8 +10,12 @@ module.exports = {
|
|
|
10
10
|
// Must use parserOptions instead of "parser" to allow vue-eslint-parser to keep working
|
|
11
11
|
// `parser: 'vue-eslint-parser'` is already included with any 'plugin:vue/**' config and should be omitted
|
|
12
12
|
parserOptions: {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
extraFileExtensions: ['.vue'],
|
|
14
|
+
parser: '@typescript-eslint/parser',
|
|
15
|
+
project: resolve(__dirname, './tsconfig.json'),
|
|
16
|
+
tsconfigRootDir: __dirname,
|
|
17
|
+
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
|
|
18
|
+
sourceType: 'module' // Allows for the use of imports
|
|
15
19
|
},
|
|
16
20
|
|
|
17
21
|
env: {
|
|
@@ -2,16 +2,18 @@
|
|
|
2
2
|
<router-view />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
<% if (typescriptConfig === 'composition') {
|
|
5
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
6
|
+
<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
7
|
+
import { defineComponent } from 'vue';
|
|
7
8
|
|
|
8
9
|
export default defineComponent({
|
|
9
10
|
name: 'App'
|
|
10
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
11
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
12
|
+
import { defineComponent } from 'vue';
|
|
11
13
|
|
|
12
14
|
export default defineComponent({
|
|
13
15
|
name: 'App'
|
|
14
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
16
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
15
17
|
import { Vue } from 'vue-class-component'
|
|
16
18
|
|
|
17
19
|
export default class App extends Vue {}<% } %>
|
|
@@ -19,8 +19,19 @@
|
|
|
19
19
|
</q-item>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
23
|
+
export interface EssentialLinkProps {
|
|
24
|
+
title: string;
|
|
25
|
+
caption?: string;
|
|
26
|
+
link?: string;
|
|
27
|
+
icon?: string;
|
|
28
|
+
}
|
|
29
|
+
withDefaults(defineProps<EssentialLinkProps>(), {
|
|
30
|
+
caption: '',
|
|
31
|
+
link: '#',
|
|
32
|
+
icon: '',
|
|
33
|
+
});<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
34
|
+
import { defineComponent } from 'vue';
|
|
24
35
|
|
|
25
36
|
export default defineComponent({
|
|
26
37
|
name: 'EssentialLink',
|
|
@@ -45,7 +56,8 @@ export default defineComponent({
|
|
|
45
56
|
default: ''
|
|
46
57
|
}
|
|
47
58
|
}
|
|
48
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
59
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
60
|
+
import { defineComponent } from 'vue';
|
|
49
61
|
|
|
50
62
|
export default defineComponent({
|
|
51
63
|
name: 'EssentialLink',
|
|
@@ -70,7 +82,7 @@ export default defineComponent({
|
|
|
70
82
|
default: ''
|
|
71
83
|
}
|
|
72
84
|
}
|
|
73
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
85
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
74
86
|
import { Vue, prop, Options } from 'vue-class-component';
|
|
75
87
|
|
|
76
88
|
class Props {
|
|
@@ -12,8 +12,29 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
16
|
+
import { computed, ref } from 'vue';
|
|
17
|
+
import { Todo, Meta } from './models';
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
title: string;
|
|
21
|
+
todos?: Todo[];
|
|
22
|
+
meta: Meta;
|
|
23
|
+
active: boolean;
|
|
24
|
+
}
|
|
25
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
26
|
+
todos: () => [],
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const clickCount = ref(0);
|
|
30
|
+
function increment() {
|
|
31
|
+
clickCount.value += 1;
|
|
32
|
+
return clickCount.value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const todoCount = computed(() => props.todos.length);
|
|
36
|
+
<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
37
|
+
import {
|
|
17
38
|
defineComponent,
|
|
18
39
|
PropType,
|
|
19
40
|
computed,
|
|
@@ -60,7 +81,8 @@ export default defineComponent({
|
|
|
60
81
|
setup (props) {
|
|
61
82
|
return { ...useClickCount(), ...useDisplayTodo(toRef(props, 'todos')) };
|
|
62
83
|
},
|
|
63
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
84
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
85
|
+
import { defineComponent, PropType } from 'vue';
|
|
64
86
|
import { Todo, Meta } from './models';
|
|
65
87
|
|
|
66
88
|
export default defineComponent({
|
|
@@ -97,7 +119,8 @@ export default defineComponent({
|
|
|
97
119
|
return this.todos.length;
|
|
98
120
|
}
|
|
99
121
|
}
|
|
100
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
122
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
123
|
+
import { Vue, prop } from 'vue-class-component';
|
|
101
124
|
import { Todo, Meta } from './models';
|
|
102
125
|
|
|
103
126
|
class Props {
|
|
@@ -45,8 +45,61 @@
|
|
|
45
45
|
</q-layout>
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
49
|
+
import { ref } from 'vue';
|
|
50
|
+
import EssentialLink, { EssentialLinkProps } from 'components/EssentialLink.vue';
|
|
51
|
+
|
|
52
|
+
const essentialLinks: EssentialLinkProps[] = [
|
|
53
|
+
{
|
|
54
|
+
title: 'Docs',
|
|
55
|
+
caption: 'quasar.dev',
|
|
56
|
+
icon: 'school',
|
|
57
|
+
link: 'https://quasar.dev'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: 'Github',
|
|
61
|
+
caption: 'github.com/quasarframework',
|
|
62
|
+
icon: 'code',
|
|
63
|
+
link: 'https://github.com/quasarframework'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: 'Discord Chat Channel',
|
|
67
|
+
caption: 'chat.quasar.dev',
|
|
68
|
+
icon: 'chat',
|
|
69
|
+
link: 'https://chat.quasar.dev'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: 'Forum',
|
|
73
|
+
caption: 'forum.quasar.dev',
|
|
74
|
+
icon: 'record_voice_over',
|
|
75
|
+
link: 'https://forum.quasar.dev'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: 'Twitter',
|
|
79
|
+
caption: '@quasarframework',
|
|
80
|
+
icon: 'rss_feed',
|
|
81
|
+
link: 'https://twitter.quasar.dev'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
title: 'Facebook',
|
|
85
|
+
caption: '@QuasarFramework',
|
|
86
|
+
icon: 'public',
|
|
87
|
+
link: 'https://facebook.quasar.dev'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: 'Quasar Awesome',
|
|
91
|
+
caption: 'Community Quasar projects',
|
|
92
|
+
icon: 'favorite',
|
|
93
|
+
link: 'https://awesome.quasar.dev'
|
|
94
|
+
}
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
const leftDrawerOpen = ref(false)
|
|
98
|
+
|
|
99
|
+
function toggleLeftDrawer() {
|
|
100
|
+
leftDrawerOpen.value = !leftDrawerOpen.value
|
|
101
|
+
}<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
102
|
+
import { defineComponent, ref } from 'vue';
|
|
50
103
|
import EssentialLink from 'components/EssentialLink.vue';
|
|
51
104
|
|
|
52
105
|
const linksList = [
|
|
@@ -112,7 +165,8 @@ export default defineComponent({
|
|
|
112
165
|
}
|
|
113
166
|
}
|
|
114
167
|
}
|
|
115
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
168
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
169
|
+
import { defineComponent } from 'vue';
|
|
116
170
|
import EssentialLink from 'components/EssentialLink.vue';
|
|
117
171
|
|
|
118
172
|
const linksList = [
|
|
@@ -179,7 +233,7 @@ export default defineComponent({
|
|
|
179
233
|
this.leftDrawerOpen = !this.leftDrawerOpen
|
|
180
234
|
}
|
|
181
235
|
}
|
|
182
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
236
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
183
237
|
import { Vue, Options } from 'vue-class-component';
|
|
184
238
|
import EssentialLink from 'components/EssentialLink.vue';
|
|
185
239
|
|
|
@@ -22,16 +22,19 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
<% if (typescriptConfig === 'composition') {
|
|
25
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
26
|
+
<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
27
|
+
import { defineComponent } from 'vue';
|
|
27
28
|
|
|
28
29
|
export default defineComponent({
|
|
29
30
|
name: 'ErrorNotFound'
|
|
30
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
31
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
32
|
+
import { defineComponent } from 'vue';
|
|
31
33
|
|
|
32
34
|
export default defineComponent({
|
|
33
35
|
name: 'ErrorNotFound'
|
|
34
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
36
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
37
|
+
import { Vue } from 'vue-class-component';
|
|
35
38
|
|
|
36
39
|
export default class ErrorNotFound extends Vue {}<% } %>
|
|
37
40
|
</script>
|
|
@@ -9,8 +9,37 @@
|
|
|
9
9
|
</q-page>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
13
|
+
import { Todo, Meta } from 'components/models';
|
|
14
|
+
import ExampleComponent from 'components/ExampleComponent.vue';
|
|
15
|
+
import { ref } from 'vue';
|
|
16
|
+
|
|
17
|
+
const todos = ref<Todo[]>([
|
|
18
|
+
{
|
|
19
|
+
id: 1,
|
|
20
|
+
content: 'ct1'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 2,
|
|
24
|
+
content: 'ct2'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 3,
|
|
28
|
+
content: 'ct3'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 4,
|
|
32
|
+
content: 'ct4'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 5,
|
|
36
|
+
content: 'ct5'
|
|
37
|
+
}
|
|
38
|
+
]);
|
|
39
|
+
const meta = ref<Meta>({
|
|
40
|
+
totalCount: 1200
|
|
41
|
+
});<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
42
|
+
import { Todo, Meta } from 'components/models';
|
|
14
43
|
import ExampleComponent from 'components/ExampleComponent.vue';
|
|
15
44
|
import { defineComponent, ref } from 'vue';
|
|
16
45
|
|
|
@@ -45,7 +74,8 @@ export default defineComponent({
|
|
|
45
74
|
});
|
|
46
75
|
return { todos, meta };
|
|
47
76
|
}
|
|
48
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
77
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
78
|
+
import { Todo, Meta } from 'components/models';
|
|
49
79
|
import ExampleComponent from 'components/ExampleComponent.vue';
|
|
50
80
|
import { defineComponent } from 'vue';
|
|
51
81
|
|
|
@@ -80,7 +110,7 @@ export default defineComponent({
|
|
|
80
110
|
};
|
|
81
111
|
return { todos, meta };
|
|
82
112
|
}
|
|
83
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
113
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
84
114
|
import { Vue, Options } from 'vue-class-component'
|
|
85
115
|
import { Todo, Meta } from 'components/models';
|
|
86
116
|
import ExampleComponent from 'components/ExampleComponent.vue';
|
|
@@ -8,6 +8,7 @@ module.exports = async function ({ scope, utils }) {
|
|
|
8
8
|
initial: 0,
|
|
9
9
|
choices: [
|
|
10
10
|
{ title: 'Composition API', value: 'composition', description: 'recommended' },
|
|
11
|
+
{ title: 'Composition API with <script setup>', value: 'composition-setup', description: 'recommended' },
|
|
11
12
|
{ title: 'Options API', value: 'options' },
|
|
12
13
|
{ title: 'Class-based', value: 'class', description: 'DEPRECATED; see https://github.com/quasarframework/quasar/discussions/11204', disabled: true }
|
|
13
14
|
]
|
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
<router-view />
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
<% if (typescriptConfig === 'composition') {
|
|
5
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
6
|
+
<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
7
|
+
import { defineComponent } from 'vue';
|
|
7
8
|
|
|
8
9
|
export default defineComponent({
|
|
9
10
|
name: 'App'
|
|
10
|
-
})<% } else if (typescriptConfig === 'options') {
|
|
11
|
+
})<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
12
|
+
import { defineComponent } from 'vue';
|
|
11
13
|
|
|
12
14
|
export default defineComponent({
|
|
13
15
|
name: 'App'
|
|
14
|
-
})<% } else if (typescriptConfig === 'class') {
|
|
16
|
+
})<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
17
|
+
import { Vue } from 'vue-class-component';
|
|
15
18
|
|
|
16
19
|
export default class App extends Vue {}<% } %>
|
|
17
20
|
</script>
|
|
@@ -19,8 +19,19 @@
|
|
|
19
19
|
</q-item>
|
|
20
20
|
</template>
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
23
|
+
export interface EssentialLinkProps {
|
|
24
|
+
title: string;
|
|
25
|
+
caption?: string;
|
|
26
|
+
link?: string;
|
|
27
|
+
icon?: string;
|
|
28
|
+
}
|
|
29
|
+
withDefaults(defineProps<EssentialLinkProps>(), {
|
|
30
|
+
caption: '',
|
|
31
|
+
link: '#',
|
|
32
|
+
icon: '',
|
|
33
|
+
});<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
34
|
+
import { defineComponent } from 'vue';
|
|
24
35
|
|
|
25
36
|
export default defineComponent({
|
|
26
37
|
name: 'EssentialLink',
|
|
@@ -45,7 +56,8 @@ export default defineComponent({
|
|
|
45
56
|
default: ''
|
|
46
57
|
}
|
|
47
58
|
}
|
|
48
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
59
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
60
|
+
import { defineComponent } from 'vue';
|
|
49
61
|
|
|
50
62
|
export default defineComponent({
|
|
51
63
|
name: 'EssentialLink',
|
|
@@ -70,7 +82,7 @@ export default defineComponent({
|
|
|
70
82
|
default: ''
|
|
71
83
|
}
|
|
72
84
|
}
|
|
73
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
85
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
74
86
|
import { Vue, prop, Options } from 'vue-class-component';
|
|
75
87
|
|
|
76
88
|
class Props {
|
|
@@ -12,8 +12,29 @@
|
|
|
12
12
|
</div>
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
16
|
+
import { computed, ref } from 'vue';
|
|
17
|
+
import { Todo, Meta } from './models';
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
title: string;
|
|
21
|
+
todos?: Todo[];
|
|
22
|
+
meta: Meta;
|
|
23
|
+
active: boolean;
|
|
24
|
+
}
|
|
25
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
26
|
+
todos: () => [],
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const clickCount = ref(0);
|
|
30
|
+
function increment() {
|
|
31
|
+
clickCount.value += 1;
|
|
32
|
+
return clickCount.value;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const todoCount = computed(() => props.todos.length);
|
|
36
|
+
<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
37
|
+
import {
|
|
17
38
|
defineComponent,
|
|
18
39
|
PropType,
|
|
19
40
|
computed,
|
|
@@ -60,7 +81,8 @@ export default defineComponent({
|
|
|
60
81
|
setup(props) {
|
|
61
82
|
return { ...useClickCount(), ...useDisplayTodo(toRef(props, 'todos')) };
|
|
62
83
|
},
|
|
63
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
84
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
85
|
+
import { defineComponent, PropType } from 'vue';
|
|
64
86
|
import { Todo, Meta } from './models';
|
|
65
87
|
|
|
66
88
|
export default defineComponent({
|
|
@@ -97,7 +119,8 @@ export default defineComponent({
|
|
|
97
119
|
return this.todos.length;
|
|
98
120
|
}
|
|
99
121
|
}
|
|
100
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
122
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
123
|
+
import { Vue, prop } from 'vue-class-component';
|
|
101
124
|
import { Todo, Meta } from './models';
|
|
102
125
|
|
|
103
126
|
class Props {
|
|
@@ -45,8 +45,61 @@
|
|
|
45
45
|
</q-layout>
|
|
46
46
|
</template>
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
49
|
+
import { ref } from 'vue';
|
|
50
|
+
import EssentialLink from 'components/EssentialLink.vue';
|
|
51
|
+
|
|
52
|
+
const essentialLinks = [
|
|
53
|
+
{
|
|
54
|
+
title: 'Docs',
|
|
55
|
+
caption: 'quasar.dev',
|
|
56
|
+
icon: 'school',
|
|
57
|
+
link: 'https://quasar.dev'
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: 'Github',
|
|
61
|
+
caption: 'github.com/quasarframework',
|
|
62
|
+
icon: 'code',
|
|
63
|
+
link: 'https://github.com/quasarframework'
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
title: 'Discord Chat Channel',
|
|
67
|
+
caption: 'chat.quasar.dev',
|
|
68
|
+
icon: 'chat',
|
|
69
|
+
link: 'https://chat.quasar.dev'
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: 'Forum',
|
|
73
|
+
caption: 'forum.quasar.dev',
|
|
74
|
+
icon: 'record_voice_over',
|
|
75
|
+
link: 'https://forum.quasar.dev'
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
title: 'Twitter',
|
|
79
|
+
caption: '@quasarframework',
|
|
80
|
+
icon: 'rss_feed',
|
|
81
|
+
link: 'https://twitter.quasar.dev'
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
title: 'Facebook',
|
|
85
|
+
caption: '@QuasarFramework',
|
|
86
|
+
icon: 'public',
|
|
87
|
+
link: 'https://facebook.quasar.dev'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
title: 'Quasar Awesome',
|
|
91
|
+
caption: 'Community Quasar projects',
|
|
92
|
+
icon: 'favorite',
|
|
93
|
+
link: 'https://awesome.quasar.dev'
|
|
94
|
+
}
|
|
95
|
+
];
|
|
96
|
+
|
|
97
|
+
const leftDrawerOpen = ref(false)
|
|
98
|
+
|
|
99
|
+
function toggleLeftDrawer() {
|
|
100
|
+
leftDrawerOpen.value = !leftDrawerOpen.value
|
|
101
|
+
}<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
102
|
+
import { defineComponent, ref } from 'vue';
|
|
50
103
|
import EssentialLink from 'components/EssentialLink.vue';
|
|
51
104
|
|
|
52
105
|
const linksList = [
|
|
@@ -112,7 +165,8 @@ export default defineComponent({
|
|
|
112
165
|
}
|
|
113
166
|
}
|
|
114
167
|
}
|
|
115
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
168
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
169
|
+
import { defineComponent } from 'vue';
|
|
116
170
|
import EssentialLink from 'components/EssentialLink.vue';
|
|
117
171
|
|
|
118
172
|
const linksList = [
|
|
@@ -179,7 +233,7 @@ export default defineComponent({
|
|
|
179
233
|
this.leftDrawerOpen = !this.leftDrawerOpen
|
|
180
234
|
}
|
|
181
235
|
}
|
|
182
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
236
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
183
237
|
import { Vue, Options } from 'vue-class-component';
|
|
184
238
|
import EssentialLink from 'components/EssentialLink.vue';
|
|
185
239
|
|
|
@@ -22,16 +22,19 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
</template>
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
<% if (typescriptConfig === 'composition') {
|
|
25
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
26
|
+
<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
27
|
+
import { defineComponent } from 'vue';
|
|
27
28
|
|
|
28
29
|
export default defineComponent({
|
|
29
30
|
name: 'ErrorNotFound'
|
|
30
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
31
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
32
|
+
import { defineComponent } from 'vue';
|
|
31
33
|
|
|
32
34
|
export default defineComponent({
|
|
33
35
|
name: 'ErrorNotFound'
|
|
34
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
36
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
37
|
+
import { Vue } from 'vue-class-component';
|
|
35
38
|
|
|
36
39
|
export default class ErrorNotFound extends Vue {}<% } %>
|
|
37
40
|
</script>
|
|
@@ -9,8 +9,37 @@
|
|
|
9
9
|
</q-page>
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
<% if (typescriptConfig === 'composition-setup') { %><script setup lang="ts">
|
|
13
|
+
import { Todo, Meta } from 'components/models';
|
|
14
|
+
import ExampleComponent from 'components/ExampleComponent.vue';
|
|
15
|
+
import { ref } from 'vue';
|
|
16
|
+
|
|
17
|
+
const todos = ref<Todo[]>([
|
|
18
|
+
{
|
|
19
|
+
id: 1,
|
|
20
|
+
content: 'ct1'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 2,
|
|
24
|
+
content: 'ct2'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 3,
|
|
28
|
+
content: 'ct3'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 4,
|
|
32
|
+
content: 'ct4'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 5,
|
|
36
|
+
content: 'ct5'
|
|
37
|
+
}
|
|
38
|
+
]);
|
|
39
|
+
const meta = ref<Meta>({
|
|
40
|
+
totalCount: 1200
|
|
41
|
+
});<% } else if (typescriptConfig === 'composition') { %><script lang="ts">
|
|
42
|
+
import { Todo, Meta } from 'components/models';
|
|
14
43
|
import ExampleComponent from 'components/ExampleComponent.vue';
|
|
15
44
|
import { defineComponent, ref } from 'vue';
|
|
16
45
|
|
|
@@ -45,7 +74,8 @@ export default defineComponent({
|
|
|
45
74
|
});
|
|
46
75
|
return { todos, meta };
|
|
47
76
|
}
|
|
48
|
-
});<% } else if (typescriptConfig === 'options') {
|
|
77
|
+
});<% } else if (typescriptConfig === 'options') { %><script lang="ts">
|
|
78
|
+
import { Todo, Meta } from 'components/models';
|
|
49
79
|
import ExampleComponent from 'components/ExampleComponent.vue';
|
|
50
80
|
import { defineComponent } from 'vue';
|
|
51
81
|
|
|
@@ -80,7 +110,7 @@ export default defineComponent({
|
|
|
80
110
|
};
|
|
81
111
|
return { todos, meta };
|
|
82
112
|
}
|
|
83
|
-
});<% } else if (typescriptConfig === 'class') {
|
|
113
|
+
});<% } else if (typescriptConfig === 'class') { %><script lang="ts">
|
|
84
114
|
import { Vue, Options } from 'vue-class-component'
|
|
85
115
|
import { Todo, Meta } from 'components/models';
|
|
86
116
|
import ExampleComponent from 'components/ExampleComponent.vue';
|
|
@@ -8,6 +8,7 @@ module.exports = async function ({ scope, utils }) {
|
|
|
8
8
|
initial: 0,
|
|
9
9
|
choices: [
|
|
10
10
|
{ title: 'Composition API', value: 'composition', description: 'recommended' },
|
|
11
|
+
{ title: 'Composition API with <script setup>', value: 'composition-setup', description: 'recommended' },
|
|
11
12
|
{ title: 'Options API', value: 'options' },
|
|
12
13
|
{ title: 'Class-based (DEPRECATED; see https://github.com/quasarframework/quasar/discussions/11204)', value: 'class', disabled: true }
|
|
13
14
|
]
|