+570
-513
lines changed Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
1
1
import { createRequire } from 'node:module'
2
-
import { defineConfig } from 'vitepress'
3
2
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
4
3
import ts from 'typescript'
4
+
import { defineConfig } from 'vitepress'
5
5
import { docsLink } from '../../macros'
6
6
import { getLocaleConfig } from './locale'
7
7
8
8
const require = createRequire(import.meta.url)
9
9
10
+
const booleanProp = require('@vue-macros/volar/boolean-prop')
11
+
const defineEmit = require('@vue-macros/volar/define-emit')
12
+
const defineModels = require('@vue-macros/volar/define-models')
10
13
// Volar plugins
11
14
const defineOptions = require('@vue-macros/volar/define-options')
12
-
const defineEmit = require('@vue-macros/volar/define-emit')
13
15
const defineProp = require('@vue-macros/volar/define-prop')
14
16
const defineProps = require('@vue-macros/volar/define-props')
15
17
const definePropsRefs = require('@vue-macros/volar/define-props-refs')
16
18
const defineSlots = require('@vue-macros/volar/define-slots')
17
-
const defineModels = require('@vue-macros/volar/define-models')
18
19
const exportExpose = require('@vue-macros/volar/export-expose')
19
20
const exportRender = require('@vue-macros/volar/export-render')
20
21
const jsxDirective = require('@vue-macros/volar/jsx-directive')
21
-
const booleanProp = require('@vue-macros/volar/boolean-prop')
22
22
23
23
export default defineConfig({
24
24
lastUpdated: true,
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
1
1
<script setup lang="ts">
2
-
import { useData } from 'vitepress'
3
-
import DefaultTheme from 'vitepress/theme'
4
-
import { nextTick, provide } from 'vue'
5
2
import {
6
3
NolebaseEnhancedReadabilitiesMenu,
7
4
NolebaseEnhancedReadabilitiesScreenMenu,
8
5
} from '@nolebase/vitepress-plugin-enhanced-readabilities/client'
9
6
import { NolebaseHighlightTargetedHeading } from '@nolebase/vitepress-plugin-highlight-targeted-heading/client'
7
+
import { useData } from 'vitepress'
8
+
import DefaultTheme from 'vitepress/theme'
9
+
import { nextTick, provide } from 'vue'
10
10
11
-
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css'
11
+
import HomePage from '../components/HomePage.vue'
12
12
import '@nolebase/vitepress-plugin-enhanced-mark/client/style.css'
13
-
import '@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css'
13
+
import '@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css'
14
14
15
-
import HomePage from '../components/HomePage.vue'
15
+
import '@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css'
16
16
17
17
const { isDark } = useData()
18
18
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
1
-
import Theme from 'vitepress/theme'
2
1
import { NolebaseGitChangelogPlugin } from '@nolebase/vitepress-plugin-git-changelog/client'
3
2
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
4
-
import WarnBadge from '../components/WarnBadge.vue'
3
+
import Theme from 'vitepress/theme'
5
4
import StabilityLevel from '../components/StabilityLevel.vue'
5
+
import WarnBadge from '../components/WarnBadge.vue'
6
6
import Layout from './Layout.vue'
7
7
import type { EnhanceAppContext } from 'vitepress'
8
-
import 'uno.css'
9
8
import './style.css'
9
+
10
10
import '@nolebase/vitepress-plugin-git-changelog/client/style.css'
11
11
import '@shikijs/vitepress-twoslash/style.css'
12
+
import 'uno.css'
12
13
13
14
export default {
14
15
...Theme,
Original file line number Diff line number Diff line change
@@ -100,11 +100,11 @@ defineExpose({
100
100
const foo = 'foo'
101
101
type Foo = string
102
102
103
-
export { type Foo, foo }
103
+
export { foo, type Foo }
104
104
// #endregion export-file
105
105
// ---cut---
106
106
// @noErrors
107
-
export { foo, type Foo, foo as bar } from './types'
107
+
export { foo, foo as bar, type Foo } from './types'
108
108
</script>
109
109
```
110
110
@@ -122,9 +122,9 @@ type Foo = string
122
122
// ---cut---
123
123
// @noErrors
124
124
import {
125
-
type Foo,
126
125
foo as __MACROS_expose_0,
127
126
foo as __MACROS_expose_1,
127
+
type Foo,
128
128
} from './types'
129
129
defineExpose({
130
130
foo: __MACROS_expose_0,
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ It is also possible to use a variable in a directive argument by wrapping it wit
121
121
<script setup lang="tsx">
122
122
// ---cut-start---
123
123
// #region v-model
124
-
import { type FunctionalComponent, ref } from 'vue'
124
+
import { ref, type FunctionalComponent } from 'vue'
125
125
126
126
export const Comp: FunctionalComponent<
127
127
{
Original file line number Diff line number Diff line change
@@ -256,7 +256,7 @@ While reactive variables relieve us from having to use `.value` everywhere, it c
256
256
Given a function that expects a ref as an argument, e.g.:
257
257
258
258
```ts twoslash
259
-
import { type Ref, watch } from 'vue'
259
+
import { watch, type Ref } from 'vue'
260
260
261
261
function trackChange(x: Ref<number>) {
262
262
watch(x, (x) => {
@@ -362,7 +362,7 @@ passAsRef($$(count))
362
362
compiles to:
363
363
364
364
```ts twoslash
365
-
import { type Ref, defineComponent, toRef } from 'vue'
365
+
import { defineComponent, toRef, type Ref } from 'vue'
366
366
function passAsRef(count: Ref<number>) {
367
367
return count
368
368
}
Original file line number Diff line number Diff line change
@@ -22,9 +22,9 @@ pnpm add -D @vue-macros/astro
22
22
23
23
```ts
24
24
// astro.config.mjs
25
-
import { defineConfig } from 'astro/config'
26
25
import Vue from '@astrojs/vue'
27
26
import Macros from '@vue-macros/astro'
27
+
import { defineConfig } from 'astro/config'
28
28
29
29
export default defineConfig({
30
30
integrations: [
Original file line number Diff line number Diff line change
@@ -22,8 +22,8 @@ pnpm add -D unplugin-vue-macros
22
22
23
23
```ts [Vite (first-class support)]
24
24
// vite.config.ts
25
-
import VueMacros from 'unplugin-vue-macros/vite'
26
25
import Vue from '@vitejs/plugin-vue'
26
+
import VueMacros from 'unplugin-vue-macros/vite'
27
27
// import VueJsx from '@vitejs/plugin-vue-jsx'
28
28
29
29
export default defineConfig({
@@ -40,8 +40,8 @@ export default defineConfig({
40
40
41
41
```ts [Rollup (first-class support)]
42
42
// rollup.config.js
43
-
import Vue from 'unplugin-vue/rollup'
44
43
import VueMacros from 'unplugin-vue-macros/rollup'
44
+
import Vue from 'unplugin-vue/rollup'
45
45
46
46
export default {
47
47
plugins: [
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
1
1
<script setup lang="ts">
2
-
import { computed, reactive, ref, watch } from 'vue'
3
2
import { useData } from 'vitepress'
3
+
import { computed, reactive, ref, watch } from 'vue'
4
4
import { useTranslate } from '../.vitepress/i18n/composable'
5
5
import {
6
-
type OptionsKey,
7
6
conflictCases,
8
7
options,
9
8
processDefineComponent,
10
9
processDefineEmits,
11
10
processDefineProps,
12
11
processDefineRender,
12
+
type OptionsKey,
13
13
} from './logic'
14
14
15
15
const t = useTranslate()
Original file line number Diff line number Diff line change
@@ -21,8 +21,8 @@ If you're using `setupSFC`, then `defineRender` cannot be disabled.
21
21
22
22
```ts {7-11} [Vite]
23
23
// vite.config.ts
24
-
import VueMacros from 'unplugin-vue-macros/vite'
25
24
import Vue from '@vitejs/plugin-vue'
25
+
import VueMacros from 'unplugin-vue-macros/vite'
26
26
27
27
export default defineConfig({
28
28
plugins: [
@@ -39,8 +39,8 @@ export default defineConfig({
39
39
```
40
40
41
41
```ts {6-13} [Rollup]
42
-
import Vue from 'unplugin-vue/rollup'
43
42
import VueMacros from 'unplugin-vue-macros/rollup'
43
+
import Vue from 'unplugin-vue/rollup'
44
44
45
45
export default defineConfig({
46
46
plugins: [
You can’t perform that action at this time.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4