Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 128 additions & 36 deletions docs/.vuepress/components/sakura-button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,92 +14,184 @@
</template>
</sakura-card>

<h3>禁用状态</h3>
<h3>禁用状态</h3>
<sakura-card>
<s-button disabled type="primary">disabled</s-button>
<template v-slot:code><pre v-highlightjs><code class="vue">{{code2}}</code></pre></template>
<template v-slot:code>
<pre v-highlightjs><code class="vue">{{code2}}</code></pre>
</template>
</sakura-card>

<h3>图标按钮</h3>
<sakura-card>
<s-button icon="home" type="primary">home</s-button>
<s-button icon="phone-fill" type="primary" icon-position="right">call</s-button>
<s-button icon="visible" type="primary">show password</s-button>
<template v-slot:code><pre v-highlightjs><code class="vue">{{code3}}</code></pre></template>
<s-button icon="home" type="primary">home</s-button>
<s-button icon="phone-fill" type="primary" icon-position="right">call</s-button>
<s-button icon="visible" type="primary">show password</s-button>
<template v-slot:code>
<pre v-highlightjs><code class="vue">{{code3}}</code></pre>
</template>
</sakura-card>

<h3>加载中</h3>
<sakura-card>
<s-button loading icon="download" type="primary">加载中</s-button>
<s-button loading icon="download" type="primary">加载中</s-button>

<template v-slot:code><pre v-highlightjs><code class="vue">{{code4}}</code></pre></template>
<template v-slot:code>
<pre v-highlightjs><code class="vue">{{code4}}</code></pre>
</template>
</sakura-card>

<h3>按钮组</h3>
<sakura-card>
<s-button-group>
<s-button icon="left" icon-position="left">prev</s-button>
<s-button>middle</s-button>
<s-button icon="right" icon-position="right">next</s-button>
<s-button icon="left" icon-position="left">prev</s-button>
<s-button>middle</s-button>
<s-button icon="right" icon-position="right">next</s-button>
</s-button-group>

<template v-slot:code><pre v-highlightjs><code class="vue">{{code5}}</code></pre></template>
<template v-slot:code>
<pre v-highlightjs><code class="vue">{{code5}}</code></pre>
</template>
</sakura-card>

</div>
</template>

<script>
import btn from '../../../src/button/button'
import btnGroup from '../../../src/button/button-group'
import Vue from 'vue'
import VueHighlightJS from 'vue-highlightjs'
import btn from "../../../src/button/button";
import btnGroup from "../../../src/button/button-group";
import Vue from "vue";
import VueHighlightJS from "vue-highlightjs";

// Tell Vue.js to use vue-highlightjs
Vue.use(VueHighlightJS)
Vue.use(VueHighlightJS);
export default {
data(){
data() {
return {
code1:`
code1: `
<s-button>default</s-button>
<s-button type="primary">primary</s-button>
<s-button type="info">info</s-button>
<s-button type="success">success</s-button>
<s-button type="warning">warning</s-button>
<s-button type="danger">danger</s-button>
`.replace(/^\s*/gm, '').trim(),
code2:`
`
.replace(/^\s*/gm, "")
.trim(),
code2: `
<s-button disabled type="primary">disabled</s-button>
`.replace(/^\s*/gm, '').trim(),
code3:`
`
.replace(/^\s*/gm, "")
.trim(),
code3: `
<s-button icon="home" type="primary">home</s-button>
<s-button icon="phone-fill" type="primary" icon-position="right">call</s-button>
<s-button icon="visible" type="primary">show password</s-button>
`.replace(/^\s*/gm, '').trim(),
code4: `
`
.replace(/^\s*/gm, "")
.trim(),
code4: `
<s-button loading icon="download" type="primary">加载中</s-button>
`.replace(/^\s*/gm, '').trim(),
code5: `
`
.replace(/^\s*/gm, "")
.trim(),
code5: `
<s-button-group>
<s-button icon="left" icon-position="left">prev</s-button>
<s-button>middle</s-button>
<s-button icon="right" icon-position="right">next</s-button>
</s-button-group>
`.replace(/^ {8}/gm, "").trim()
}
`
.replace(/^ {8}/gm, "")
.trim()
};
},
components:{
's-button':btn,
's-button-group':btnGroup
components: {
"s-button": btn,
"s-button-group": btnGroup
}
}
};
</script>

<style lang="scss" scoped>

</style>
<style>
.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-variable,.hljs-template-variable,.hljs-tag,.hljs-name,.hljs-selector-id,.hljs-selector-class,.hljs-regexp,.hljs-deletion{color:#ffa07a}.hljs-number,.hljs-built_in,.hljs-builtin-name,.hljs-literal,.hljs-type,.hljs-params,.hljs-meta,.hljs-link{color:#f5ab35}.hljs-attribute{color:#ffd700}.hljs-string,.hljs-symbol,.hljs-bullet,.hljs-addition{color:#abe338}.hljs-title,.hljs-section{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs{display:block;overflow-x:auto;background:#2b2b2b;color:#f8f8f2;padding:.5em}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}@media screen and (-ms-high-contrast:active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-builtin-name,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-string,.hljs-symbol,.hljs-type,.hljs-quote{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:bold}}
.hljs-comment,
.hljs-quote {
color: #d4d0ab;
}
.hljs-variable,
.hljs-template-variable,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-regexp,
.hljs-deletion {
color: #ffa07a;
}
.hljs-number,
.hljs-built_in,
.hljs-builtin-name,
.hljs-literal,
.hljs-type,
.hljs-params,
.hljs-meta,
.hljs-link {
color: #f5ab35;
}
.hljs-attribute {
color: #ffd700;
}
.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition {
color: #abe338;
}
.hljs-title,
.hljs-section {
color: #00e0e0;
}
.hljs-keyword,
.hljs-selector-tag {
color: #dcc6e0;
}
.hljs {
display: block;
overflow-x: auto;
background: #2b2b2b;
color: #f8f8f2;
padding: 0.5em;
}
.hljs-emphasis {
font-style: italic;
}
.hljs-strong {
font-weight: bold;
}
@media screen and (-ms-high-contrast: active) {
.hljs-addition,
.hljs-attribute,
.hljs-built_in,
.hljs-builtin-name,
.hljs-bullet,
.hljs-comment,
.hljs-link,
.hljs-literal,
.hljs-meta,
.hljs-number,
.hljs-params,
.hljs-string,
.hljs-symbol,
.hljs-type,
.hljs-quote {
color: highlight;
}
.hljs-keyword,
.hljs-selector-tag {
font-weight: bold;
}
}
</style>


84 changes: 62 additions & 22 deletions docs/.vuepress/components/sakura-container.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@
<div>
<h3>样式1</h3>
<sakura-card>
<div style="width:600px">
<s-layout height="400">
<s-header height="100">header</s-header>
<s-layout>
<s-content>content</s-content>
</s-layout>
<s-footer>footer</s-footer>
<div>
<s-layout height="400">
<s-header height="100">header</s-header>
<s-layout>
<s-content>content</s-content>
</s-layout>
</div>
<s-footer>footer</s-footer>
</s-layout>
</div>

<template v-slot:code><pre v-highlightjs><code class="vue">{{code1}}</code></pre></template>
<template v-slot:code>
<pre v-highlightjs><code class="vue">{{code1}}</code></pre>
</template>
</sakura-card>

<h3>样式2</h3>
<sakura-card>
<div style="width:600px">
<div>
<s-layout height="400">
<s-header height="100">header</s-header>
<s-layout>
Expand All @@ -28,12 +30,14 @@
</s-layout>
</div>

<template v-slot:code><pre v-highlightjs><code class="vue">{{code2}}</code></pre></template>
<template v-slot:code>
<pre v-highlightjs><code class="vue">{{code2}}</code></pre>
</template>
</sakura-card>

<h3>样式3</h3>
<sakura-card>
<div style="width:600px">
<div>
<s-layout height="400">
<s-header height="100">header</s-header>
<s-layout>
Expand All @@ -44,12 +48,14 @@
</s-layout>
</div>

<template v-slot:code><pre v-highlightjs><code class="vue">{{code3}}</code></pre></template>
<template v-slot:code>
<pre v-highlightjs><code class="vue">{{code3}}</code></pre>
</template>
</sakura-card>

<h3>样式4</h3>
<sakura-card>
<div style="width:600px">
<div>
<s-layout height="400">
<s-sider width="200">sidebar</s-sider>
<s-layout>
Expand All @@ -60,10 +66,11 @@
</s-layout>
</div>

<template v-slot:code><pre v-highlightjs><code class="vue">{{code4}}</code></pre></template>
<template v-slot:code>
<pre v-highlightjs><code class="vue">{{code4}}</code></pre>
</template>
</sakura-card>

</div>
</div>
</template>
<script>
import Layout from "../../../src/container/layout";
Expand All @@ -82,7 +89,9 @@ export default {
</s-layout>
<s-footer>footer</s-footer>
</s-layout>
`.replace(/^ {8}/gm, "").trim(),
`
.replace(/^ {8}/gm, "")
.trim(),
code2: `
<s-layout height="400">
<s-header height="100">header</s-header>
Expand All @@ -92,7 +101,9 @@ export default {
</s-layout>
<s-footer>footer</s-footer>
</s-layout>
`.replace(/^ {8}/gm, "").trim(),
`
.replace(/^ {8}/gm, "")
.trim(),
code3: `
<s-layout height="400">
<s-header height="100">header</s-header>
Expand All @@ -102,7 +113,9 @@ export default {
</s-layout>
<s-footer>footer</s-footer>
</s-layout>
`.replace(/^ {8}/gm, "").trim(),
`
.replace(/^ {8}/gm, "")
.trim(),
code4: `
<s-layout height="400">
<s-sider width="200">sidebar</s-sider>
Expand All @@ -112,7 +125,9 @@ export default {
<s-footer>footer</s-footer>
</s-layout>
</s-layout>
`.replace(/^ {8}/gm, "").trim()
`
.replace(/^ {8}/gm, "")
.trim()
};
},
components: {
Expand All @@ -124,6 +139,31 @@ export default {
}
};
</script>
<style lang="scss" scoped>
<style>
.s-layout {
width: 100%;
color: #fff;
text-align: center;
}
.s-header,
.s-content,
.s-footer,
.s-sider {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
}
.s-header,
.s-footer {
background: #7dbcea;
}
.s-content {
background: #108ee9;
height: 240px;
}
.s-sider {
background: #3ba0e9;
}
</style>

Loading