-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: supports directive & lazy load component
- Loading branch information
Showing
12 changed files
with
2,495 additions
and
1,290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// eslint.config.js | ||
import antfu from '@antfu/eslint-config' | ||
|
||
export default antfu() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,9 @@ | ||
<script setup lang="ts"> | ||
const show = ref(false) | ||
const showSnackBar = () => { | ||
Snackbar({ | ||
content: '这是一个消息条!!', | ||
duration: 1000 | ||
}) | ||
} | ||
import '@varlet/touch-emulator' | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<var-button type="primary" block @click="show = !show"> | ||
66666666 | ||
</var-button> | ||
<var-button @click="showSnackBar"> | ||
wudi | ||
</var-button> | ||
<client-only> | ||
<var-snackbar v-model:show="show"> | ||
这是一个消息条!! | ||
</var-snackbar> | ||
</client-only> | ||
<!-- <div v-ripple class="ripple-example-block"> | ||
点击 | ||
</div> --> | ||
<var-skeleton :loading="show"> | ||
加载的数据 | ||
</var-skeleton> | ||
</div> | ||
<nuxt-layout> | ||
<nuxt-page /> | ||
</nuxt-layout> | ||
</template> | ||
|
||
<style> | ||
.ripple-example-block { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100px; | ||
user-select: none; | ||
cursor: pointer; | ||
color: #888; | ||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
transition: background-color 0.25s; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
{ | ||
"name": "my-module-playground", | ||
"private": true, | ||
"name": "my-module-playground" | ||
"dependencies": { | ||
"@varlet/touch-emulator": "^3.0.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script setup lang="ts"> | ||
import { Themes } from '@varlet/ui' | ||
</script> | ||
|
||
<template> | ||
<lazy-var-button @click="() => StyleProvider(Themes.dark)"> | ||
ceshi | ||
</lazy-var-button> | ||
<lazy-var-paper | ||
v-hover="{ color: 'var(--color-on-primary)', background: 'var(--color-primary)' }" | ||
ripple | ||
class="paper" | ||
:elevation="2" | ||
:width="100" | ||
:height="100" | ||
> | ||
HOVER ME | ||
</lazy-var-paper> | ||
<nuxt-link to="/"> | ||
back | ||
</nuxt-link> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<script setup lang="ts"> | ||
import { Themes } from '@varlet/ui' | ||
const show = ref(false) | ||
function showSnackBar() { | ||
Snackbar({ | ||
content: '这是一个消息条!!', | ||
duration: 1000, | ||
}) | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<VarButton>wefwef</VarButton> | ||
<nuxt-link to="/demo"> | ||
link to demo qwef | ||
</nuxt-link> | ||
|
||
<var-button block @click="() => StyleProvider(Themes.md3Light)"> | ||
Material Design 3 暗色 | ||
</var-button> | ||
<var-button type="primary" block @click="show = !show"> | ||
66666666 | ||
</var-button> | ||
<var-button @click="showSnackBar"> | ||
wudi | ||
</var-button> | ||
<client-only> | ||
<var-snackbar v-model:show="show"> | ||
这是一个消息条!! | ||
</var-snackbar> | ||
</client-only> | ||
<div v-ripple class="ripple-example-block"> | ||
点击 | ||
</div> | ||
<var-skeleton :loading="show"> | ||
加载的数据 | ||
</var-skeleton> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
.ripple-example-block { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100px; | ||
user-select: none; | ||
cursor: pointer; | ||
color: #888; | ||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | ||
transition: background-color 0.25s; | ||
} | ||
</style> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.