0

我对使用 Vue Material 的 Onboarding 组件非常陌生。我希望将其用作照片的旋转木马。我正在尝试在我的项目中实施,但看起来有点乱。有人知道官方网站上的一些文档吗?

谢谢

    <md-layout md-row md-align="center" md-flex-xsmall="100" md-flex-small="100" md-flex-medium="50">
            <md-boards :md-auto="true" :md-infinite="true" :md-duration="5000" :md-swipeable="true" :md-controls="true" md-swipe-distance="50">
                <md-board id="slide1">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt dolorum quas amet cum vitae, omnis! Illum quas voluptatem, expedita iste, dicta ipsum ea veniam dolore in, quod saepe reiciendis nihil.</p>
                </md-board>
                <md-board id="slide2">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt dolorum quas amet cum vitae, omnis! Illum quas voluptatem, expedita iste, dicta ipsum ea veniam dolore in, quod saepe reiciendis nihil.</p>
                </md-board>
                <md-board id="slide3">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt dolorum quas amet cum vitae, omnis! Illum quas voluptatem, expedita iste, dicta ipsum ea veniam dolore in, quod saepe reiciendis nihil.</p>
                </md-board>
                <md-board id="slide4">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt dolorum quas amet cum vitae, omnis! Illum quas voluptatem, expedita iste, dicta ipsum ea veniam dolore in, quod saepe reiciendis nihil.</p>
                </md-board>
            </md-boards>
</md-layout>

所有 Lorem P 标签都显示在同一张幻灯片上(编号 1),其他 3 个显示为空。

4

1 回答 1

0

看起来不错(但有一个语法错误 - 缺少:'md-swipe-distance="50"' 之前的字符。

我认为如果您:a.)包含所有必需的依赖项(CSS,JS)b.)使用材料初始化 Vue,它应该可以工作

代码:

HTML:

<div id="app">
 <md-layout md-row md-align="center" md-flex-xsmall="100" md-flex-small="100" md-flex-medium="50">
            <md-boards :md-auto="true" :md-infinite="true" :md-duration="5000" :md-swipeable="true" :md-controls="true" :md-swipe-distance="50">
                <md-board id="slide1">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt dolorum quas amet cum vitae, omnis! Illum quas voluptatem, expedita iste, dicta ipsum ea veniam dolore in, quod saepe reiciendis nihil.</p>
                </md-board>
                <md-board id="slide2">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt dolorum quas amet cum vitae, omnis! Illum quas voluptatem, expedita iste, dicta ipsum ea veniam dolore in, quod saepe reiciendis nihil.</p>
                </md-board>
                <md-board id="slide3">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt dolorum quas amet cum vitae, omnis! Illum quas voluptatem, expedita iste, dicta ipsum ea veniam dolore in, quod saepe reiciendis nihil.</p>
                </md-board>
                <md-board id="slide4">
                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Deserunt dolorum quas amet cum vitae, omnis! Illum quas voluptatem, expedita iste, dicta ipsum ea veniam dolore in, quod saepe reiciendis nihil.</p>
                </md-board>
            </md-boards>
</md-layout>
</div>

JS:

Vue.use(VueMaterial);

new Vue({
  el: '#app'
  , methods: {

  }
});

并包括“依赖项”;

CSS:

//unpkg.com/vue-material@0.7.4/dist/vue-material.css
//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic
//fonts.googleapis.com/icon?family=Material+Icons

JS:

//unpkg.com/vue@2.2.4
//unpkg.com/vue-material@latest

Codepen 玩它:

https://codepen.io/anon/pen/vZMqEx

祝你好运:D

于 2017-07-17T14:18:23.143 回答