You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
2.3 KiB
119 lines
2.3 KiB
{
|
|
"page": {
|
|
"prefix": "page",
|
|
"scope": "vue",
|
|
"body": [
|
|
"<template>",
|
|
" <cl-page>",
|
|
" <view class=\"page\">",
|
|
" $1",
|
|
" </view>",
|
|
" </cl-page>",
|
|
"</template>",
|
|
"",
|
|
"<script lang=\"ts\" setup>",
|
|
"import { useCool } from \"/@/cool\";",
|
|
"",
|
|
"const { service, router } = useCool();",
|
|
"</script>",
|
|
"",
|
|
"<style lang=\"scss\" scoped>",
|
|
".page {",
|
|
" ",
|
|
"}",
|
|
"</style>",
|
|
"",
|
|
],
|
|
"description": "page snippets",
|
|
},
|
|
"component": {
|
|
"prefix": "component",
|
|
"scope": "vue",
|
|
"body": [
|
|
"<template>",
|
|
" <view class=\"$1\">",
|
|
" ",
|
|
" </view>",
|
|
"</template>",
|
|
"",
|
|
"<script lang=\"ts\" setup>",
|
|
"import { useCool } from \"/@/cool\";",
|
|
"",
|
|
"const { service, router } = useCool();",
|
|
"</script>",
|
|
"",
|
|
"<style lang=\"scss\" scoped>",
|
|
".component$2 {",
|
|
" ",
|
|
"}",
|
|
"</style>",
|
|
"",
|
|
],
|
|
"description": "component snippets",
|
|
},
|
|
"popup": {
|
|
"prefix": "popup",
|
|
"scope": "vue",
|
|
"body": [
|
|
"<template>",
|
|
" <cl-popup v-model=\"visible\" direction=\"bottom\">",
|
|
" <view class=\"component$1\"> </view>",
|
|
" </cl-popup>",
|
|
"</template>",
|
|
"",
|
|
"<script lang=\"ts\" setup>",
|
|
"import { ref } from \"vue\";",
|
|
"import { useCool } from \"/@/cool\";",
|
|
"",
|
|
"const { service, router } = useCool();",
|
|
"",
|
|
"// 是否可见",
|
|
"const visible = ref(false);",
|
|
"",
|
|
"// 打开",
|
|
"function open() {",
|
|
" visible.value = true;",
|
|
"}",
|
|
"",
|
|
"// 关闭",
|
|
"function close() {",
|
|
" visible.value = false;",
|
|
"}",
|
|
"",
|
|
"defineExpose({",
|
|
" open,",
|
|
" close,",
|
|
"});",
|
|
"</script>",
|
|
"",
|
|
"<style lang=\"scss\" scoped>",
|
|
".component {",
|
|
"}",
|
|
"</style>",
|
|
"",
|
|
],
|
|
"description": "popup snippets",
|
|
},
|
|
"pager": {
|
|
"prefix": "pager",
|
|
"scope": "typescript",
|
|
"body": [
|
|
"const { service } = useCool();",
|
|
"const { onRefresh, list } = usePager();",
|
|
"",
|
|
"function refresh(params?: any) {",
|
|
" const { data, next } = onRefresh(params);",
|
|
" next(service.$1.page(data));",
|
|
"}",
|
|
"",
|
|
"onReady(() => {",
|
|
" refresh();",
|
|
"});",
|
|
"",
|
|
"defineExpose({",
|
|
" refresh,",
|
|
"});",
|
|
],
|
|
"description": "pager snippets",
|
|
},
|
|
}
|
|
|