From 9d8b06c1b0361105777c926a94a93a6ece810d6b Mon Sep 17 00:00:00 2001 From: "huanqing.shao" Date: Sun, 1 Sep 2019 21:49:49 +0800 Subject: [PATCH] =?UTF-8?q?StoryBook=20=E5=85=BC=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vuepress/components/StoryBook.vue | 29 ++++++++++++----------------- .vuepress/config.js | 16 ++++++++-------- .vuepress/styles/index.styl | 1 + docker-compose.yaml | 21 +++++++++++++++++++++ install/install-k8s.md | 3 ++- 5 files changed, 44 insertions(+), 26 deletions(-) create mode 100644 docker-compose.yaml diff --git a/.vuepress/components/StoryBook.vue b/.vuepress/components/StoryBook.vue index 15d96ab..0ee5796 100644 --- a/.vuepress/components/StoryBook.vue +++ b/.vuepress/components/StoryBook.vue @@ -3,13 +3,12 @@
{{$page.frontmatter.storyBook.title}} --- - {{slides[activeIndex] ? slides[activeIndex].title : ''}} - 全文阅读
@@ -21,8 +20,8 @@ :style="activeIndex === index ? '' : 'cursor: pointer; opacity: 0.5;'">
-
+
分步阅读 @@ -67,6 +64,8 @@ export default { slides: [] } }, + created () { + }, mounted () { this.$nextTick(_ => { for (let item of this.$page.frontmatter.storyBook.pages) { @@ -86,6 +85,7 @@ export default { if (this.dialogVisible) { setTimeout(_ => { if (_this.mySwiper === undefined) { + console.log('new swiper') _this.mySwiper = new Swiper ('.swiper-container', { hashNavigation: { watchState: true, @@ -104,26 +104,24 @@ export default { effect: 'coverflow', on:{ slideChange: function(a){ - console.log('slideChange') _this.$nextTick(_ => { _this.activeIndex = _this.mySwiper.activeIndex }) }, }, - observer:true, + // observer:true, // navigation: { // nextEl: '.swiper-button-next', // prevEl: '.swiper-button-prev', // } }) } - for (let item of this.slides) { - // console.log(`dialog_${item.name}`, document.getElementById(`dialog_${item.name}`)) - document.getElementById(`dialog_${item.name}`).appendChild(document.getElementById(item.name)) - } - for (let item of this.slides) { - document.getElementById(`dialog_${item.name}`).scrollTop = 0 - } + setTimeout(_ => { + for (let item of this.slides) { + // console.log(`dialog_${item.name}`, document.getElementById(`dialog_${item.name}`)) + document.getElementById(`dialog_${item.name}`).appendChild(document.getElementById(item.name)) + } + }, 100) }, 100) } else { setTimeout(_ => { @@ -166,9 +164,6 @@ export default { event.preventDefault() this.mySwiper.slidePrev() } - }, - next() { - if (this.active++ >= this.$page.frontmatter.storyBook.pages.length) this.active = 0; } } } diff --git a/.vuepress/config.js b/.vuepress/config.js index 4e13bcd..5d1fad2 100644 --- a/.vuepress/config.js +++ b/.vuepress/config.js @@ -34,14 +34,14 @@ module.exports = { return dateFns.format(timestamp, 'YYYY-MM-DD HH:mm:ss') } }, - '@vuepress/medium-zoom': { - selector: 'p img', - // medium-zoom options here - // See: https://github.com/francoischalifour/medium-zoom#options - options: { - margin: 16 - } - }, + // '@vuepress/medium-zoom': { + // selector: 'p img', + // // medium-zoom options here + // // See: https://github.com/francoischalifour/medium-zoom#options + // options: { + // margin: 16 + // } + // }, 'code-switcher': {}, 'reading-progress': {}, 'vuepress-plugin-element-tabs': {}, diff --git a/.vuepress/styles/index.styl b/.vuepress/styles/index.styl index 45e1d3b..7afd7f4 100644 --- a/.vuepress/styles/index.styl +++ b/.vuepress/styles/index.styl @@ -3,6 +3,7 @@ } p img { border: 1px solid #d7dae2; + max-width: calc(70vw - 40px); } .noselect { diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..de3627e --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,21 @@ +version: "3" +services: + web: + # replace username/repo:tag with your name and image details + image: eipwork/kuboard-press:20190901-210235 + deploy: + replicas: 1 + resources: + limits: + cpus: "0.1" + memory: 500M + restart_policy: + condition: on-failure + ports: + - "9080:80" + volumes: + - ./docs:/usr/share/nginx/html + networks: + - webnet +networks: + webnet: diff --git a/install/install-k8s.md b/install/install-k8s.md index f4e9a34..7bb94d7 100644 --- a/install/install-k8s.md +++ b/install/install-k8s.md @@ -30,7 +30,6 @@ storyBook: export default { data () { let validateEnv = (rule, value, callback) => { - console.log('validate', value) if (value.length < 3) { callback(new Error('请确认您的环境符合上述条件')); } else { @@ -46,6 +45,8 @@ export default { } } }, + mounted () { + }, watch: { 'form.checked' () { if (this.form.checked.length === 3) {