snippets
Former-commit-id: 9cbb99a3c18175868240f935a9206b444a348498 [formerly 9cbb99a3c18175868240f935a9206b444a348498 [formerly 9cbb99a3c18175868240f935a9206b444a348498 [formerly 9cbb99a3c18175868240f935a9206b444a348498 [formerly 0f8c2e0ea59ba851189ea34301c6c81114959330 [formerly 6141bff6cc8fa8952def02daf74da9ef26619295]]]]] Former-commit-id: 288acba392eb45bd53ebb4d5c526084d0a1f8098 Former-commit-id: 9488c71842d0ecfd9c6ad6f490282c68cea52600 Former-commit-id: 1d0724ce14cf93561aab3ee98d5ea74a754b918c [formerly fbb819243dde04ffa2c65192cdb78b20f4d7158a] Former-commit-id: ea177f9bb196ecdce73a32e61d928546fbbc0a66 Former-commit-id: 616e3663b7ab4815145ec0d06624c3f28be624f8 Former-commit-id: 58ffcebefc819157def5920f1d5dffb570f2d0ac Former-commit-id: 37dbd8c1f26a2d238198bbc89555b12213635bdf Former-commit-id: 8b2bd5cbd92702b23d354fb8a3c3a860eed5dabc
This commit is contained in:
parent
835d2bb1dd
commit
04ffdc1a79
|
|
@ -1,59 +1,82 @@
|
|||
{
|
||||
// 一个新的页面
|
||||
"d2-new-page": {
|
||||
"prefix": "dd-new-page",
|
||||
"body": [
|
||||
"<template>",
|
||||
" <d2-container type=\"${1:full}\" class=\"page\">",
|
||||
" ${2:page-name}",
|
||||
" </d2-container>",
|
||||
"</template>",
|
||||
"",
|
||||
"<script>",
|
||||
"export default {",
|
||||
// 一个新的页面
|
||||
"d2-new-page": {
|
||||
"prefix": "dd-new-page",
|
||||
"body": [
|
||||
"<template>",
|
||||
" <d2-container class=\"${1:page-name}\">",
|
||||
" <!--",
|
||||
" 可选 type = full(默认) | card | ghost",
|
||||
" 可选 better-scroll 属性",
|
||||
" 可选 better-scroll-option 属性",
|
||||
" 文档 http://d2admin.fairyever.com/zh/components/container.html",
|
||||
" -->",
|
||||
" <template slot=\"header\">header</template>",
|
||||
" <span class=\"${1:page-name}_title\">this is [ {{name}} ]</span>",
|
||||
" <template slot=\"footer\">footer</template>",
|
||||
" </d2-container>",
|
||||
"</template>",
|
||||
"<script>",
|
||||
"import { mapState, mapMutations } from 'vuex'",
|
||||
"export default {",
|
||||
" name: '${1:page-name}',",
|
||||
" data () {",
|
||||
" return {}",
|
||||
" },",
|
||||
" computed: {",
|
||||
" return {",
|
||||
" name: '${1:page-name}'",
|
||||
" }",
|
||||
" },",
|
||||
" methods: {",
|
||||
" computed: {",
|
||||
" ...mapState({",
|
||||
" // 访问用户信息",
|
||||
" userInfo: state => state.d2admin.userInfo",
|
||||
" })",
|
||||
" },",
|
||||
" methods: {",
|
||||
" ...mapMutations([",
|
||||
" // 操作公用数据",
|
||||
" 'd2adminUtilDatabase',",
|
||||
" // 操作用户私有数据",
|
||||
" 'd2adminUtilDatabaseUser'",
|
||||
" ])",
|
||||
" }",
|
||||
"}",
|
||||
"</script>",
|
||||
"",
|
||||
"<style lang=\"scss\" scoped>",
|
||||
"@import '~@/assets/style/public.scss';",
|
||||
".page {",
|
||||
" // Your page style here",
|
||||
" // Do not use empty rulesets",
|
||||
" // If empty, delete it",
|
||||
"}",
|
||||
"</style>"
|
||||
],
|
||||
"description": "new page"
|
||||
},
|
||||
// d2-container 组件 header 插槽
|
||||
"d2-container-header": {
|
||||
"prefix": "dd-container-header",
|
||||
"body": [
|
||||
"<template slot=\"header\">${1:header}</template>"
|
||||
],
|
||||
"description": "d2-container component header slot"
|
||||
},
|
||||
// d2-container 组件 footer 插槽
|
||||
"d2-container-footer": {
|
||||
"prefix": "dd-container-footer",
|
||||
"body": [
|
||||
"<template slot=\"footer\">${1:footer}</template>"
|
||||
],
|
||||
"description": "d2-container component footer slot"
|
||||
},
|
||||
// 图标组件
|
||||
"d2-icon": {
|
||||
"prefix": "dd-icon",
|
||||
"body": [
|
||||
"<d2-icon name=\"${1:github}\"/>"
|
||||
],
|
||||
"description": "d2-icon component"
|
||||
}
|
||||
"</script>",
|
||||
"<style lang=\"scss\" scoped>",
|
||||
"@import '~@/assets/style/public.scss';",
|
||||
".${1:page-name} {",
|
||||
" .${1:page-name}_title {",
|
||||
" font-size: 14px;",
|
||||
" }",
|
||||
" // Your page style here",
|
||||
" // Do not use empty rulesets",
|
||||
" // If the page does not need an additional definition style, please delete",
|
||||
"}",
|
||||
"</style>"
|
||||
],
|
||||
"description": "new page"
|
||||
},
|
||||
// d2-container 组件 header 插槽
|
||||
"d2-container-header": {
|
||||
"prefix": "dd-container-header",
|
||||
"body": [
|
||||
"<template slot=\"header\">${1:header}</template>"
|
||||
],
|
||||
"description": "d2-container component header slot"
|
||||
},
|
||||
// d2-container 组件 footer 插槽
|
||||
"d2-container-footer": {
|
||||
"prefix": "dd-container-footer",
|
||||
"body": [
|
||||
"<template slot=\"footer\">${1:footer}</template>"
|
||||
],
|
||||
"description": "d2-container component footer slot"
|
||||
},
|
||||
// 图标组件
|
||||
"d2-icon": {
|
||||
"prefix": "dd-icon",
|
||||
"body": [
|
||||
"<d2-icon name=\"${1:github}\"/>"
|
||||
],
|
||||
"description": "d2-icon component"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,59 +1,82 @@
|
|||
{
|
||||
// 一个新的页面
|
||||
"d2-new-page": {
|
||||
"prefix": "dd-new-page",
|
||||
"body": [
|
||||
"<template>",
|
||||
" <d2-container type=\"${1:full}\" class=\"page\">",
|
||||
" ${2:page-name}",
|
||||
" </d2-container>",
|
||||
"</template>",
|
||||
"",
|
||||
"<script>",
|
||||
"export default {",
|
||||
// 一个新的页面
|
||||
"d2-new-page": {
|
||||
"prefix": "dd-new-page",
|
||||
"body": [
|
||||
"<template>",
|
||||
" <d2-container class=\"${1:page-name}\">",
|
||||
" <!--",
|
||||
" 可选 type = full(默认) | card | ghost",
|
||||
" 可选 better-scroll 属性",
|
||||
" 可选 better-scroll-option 属性",
|
||||
" 文档 http://d2admin.fairyever.com/zh/components/container.html",
|
||||
" -->",
|
||||
" <template slot=\"header\">header</template>",
|
||||
" <span class=\"${1:page-name}_title\">this is [ {{name}} ]</span>",
|
||||
" <template slot=\"footer\">footer</template>",
|
||||
" </d2-container>",
|
||||
"</template>",
|
||||
"<script>",
|
||||
"import { mapState, mapMutations } from 'vuex'",
|
||||
"export default {",
|
||||
" name: '${1:page-name}',",
|
||||
" data () {",
|
||||
" return {}",
|
||||
" },",
|
||||
" computed: {",
|
||||
" return {",
|
||||
" name: '${1:page-name}'",
|
||||
" }",
|
||||
" },",
|
||||
" methods: {",
|
||||
" computed: {",
|
||||
" ...mapState({",
|
||||
" // 访问用户信息",
|
||||
" userInfo: state => state.d2admin.userInfo",
|
||||
" })",
|
||||
" },",
|
||||
" methods: {",
|
||||
" ...mapMutations([",
|
||||
" // 操作公用数据",
|
||||
" 'd2adminUtilDatabase',",
|
||||
" // 操作用户私有数据",
|
||||
" 'd2adminUtilDatabaseUser'",
|
||||
" ])",
|
||||
" }",
|
||||
"}",
|
||||
"</script>",
|
||||
"",
|
||||
"<style lang=\"scss\" scoped>",
|
||||
"@import '~@/assets/style/public.scss';",
|
||||
".page {",
|
||||
" // Your page style here",
|
||||
" // Do not use empty rulesets",
|
||||
" // If empty, delete it",
|
||||
"}",
|
||||
"</style>"
|
||||
],
|
||||
"description": "new page"
|
||||
},
|
||||
// d2-container 组件 header 插槽
|
||||
"d2-container-header": {
|
||||
"prefix": "dd-container-header",
|
||||
"body": [
|
||||
"<template slot=\"header\">${1:header}</template>"
|
||||
],
|
||||
"description": "d2-container component header slot"
|
||||
},
|
||||
// d2-container 组件 footer 插槽
|
||||
"d2-container-footer": {
|
||||
"prefix": "dd-container-footer",
|
||||
"body": [
|
||||
"<template slot=\"footer\">${1:footer}</template>"
|
||||
],
|
||||
"description": "d2-container component footer slot"
|
||||
},
|
||||
// 图标组件
|
||||
"d2-icon": {
|
||||
"prefix": "dd-icon",
|
||||
"body": [
|
||||
"<d2-icon name=\"${1:github}\"/>"
|
||||
],
|
||||
"description": "d2-icon component"
|
||||
}
|
||||
"</script>",
|
||||
"<style lang=\"scss\" scoped>",
|
||||
"@import '~@/assets/style/public.scss';",
|
||||
".${1:page-name} {",
|
||||
" .${1:page-name}_title {",
|
||||
" font-size: 14px;",
|
||||
" }",
|
||||
" // Your page style here",
|
||||
" // Do not use empty rulesets",
|
||||
" // If the page does not need an additional definition style, please delete",
|
||||
"}",
|
||||
"</style>"
|
||||
],
|
||||
"description": "new page"
|
||||
},
|
||||
// d2-container 组件 header 插槽
|
||||
"d2-container-header": {
|
||||
"prefix": "dd-container-header",
|
||||
"body": [
|
||||
"<template slot=\"header\">${1:header}</template>"
|
||||
],
|
||||
"description": "d2-container component header slot"
|
||||
},
|
||||
// d2-container 组件 footer 插槽
|
||||
"d2-container-footer": {
|
||||
"prefix": "dd-container-footer",
|
||||
"body": [
|
||||
"<template slot=\"footer\">${1:footer}</template>"
|
||||
],
|
||||
"description": "d2-container component footer slot"
|
||||
},
|
||||
// 图标组件
|
||||
"d2-icon": {
|
||||
"prefix": "dd-icon",
|
||||
"body": [
|
||||
"<d2-icon name=\"${1:github}\"/>"
|
||||
],
|
||||
"description": "d2-icon component"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
34
src/demo.vue
34
src/demo.vue
|
|
@ -1,27 +1,47 @@
|
|||
<template>
|
||||
<d2-container type="full" :scroll="false" class="page-name">
|
||||
<d2-container class="demo-page">
|
||||
<!--
|
||||
可选 type = full(默认) | card | ghost
|
||||
可选 better-scroll 属性
|
||||
可选 better-scroll-option 属性
|
||||
文档 http://d2admin.fairyever.com/zh/components/container.html
|
||||
-->
|
||||
<template slot="header">header</template>
|
||||
this is [ page-name ]
|
||||
<span class="demo-page_title">this is [ {{name}} ]</span>
|
||||
<template slot="footer">footer</template>
|
||||
</d2-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations } from 'vuex'
|
||||
export default {
|
||||
name: 'page-name',
|
||||
name: 'demo-page',
|
||||
data () {
|
||||
return {}
|
||||
return {
|
||||
name: 'demo-page'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
// 访问用户信息
|
||||
userInfo: state => state.d2admin.userInfo
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
// 操作公用数据
|
||||
'd2adminUtilDatabase',
|
||||
// 操作用户私有数据
|
||||
'd2adminUtilDatabaseUser'
|
||||
])
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '~@/assets/style/public.scss';
|
||||
.page-name {
|
||||
.demo-page {
|
||||
.demo-page_title {
|
||||
font-size: 14px;
|
||||
}
|
||||
// Your page style here
|
||||
// Do not use empty rulesets
|
||||
// If the page does not need an additional definition style, please delete
|
||||
|
|
|
|||
Loading…
Reference in New Issue