1.0.0 • Published 4 years ago
freedomshow-xyit v1.0.0
freedomshow-vue
freedomshow
Build Setup
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
#发布
npm publish
#引用
main.js
import freedomshow from 'freedomshow-vue';
Vue.use(freedomshow);
#使用
*.vue
<ecard-preview :code="code" :preview="100" ref="ecardPreview"></ecard-preview>
<ecard-editor v-model="template" :option="option" ref="ecardEditor" @exit="exit" @save="save" @saveTo="saveTo">
<div slot="picture">
picture
</div>
<div slot="audio">
audio
</div>
<div slot="video">
video
</div>
<div slot="setPicture">
<span @click="setPicture">setPicture</span>
</div>
<div slot="setAudio">
<span @click="setAudio">setAudio</span>
</div>
<div slot="setVideo">
<span @click="setVideo">setVideo</span>
</div>
<div slot="setTemplate">
<span @click="setTemplate">setTemplate</span>
</div>
</ecard-editor>
ecardEditorShow() {
this.$ecardPath("localhost:8080");
this.$ecardDate(()=>new Date());
for (let item in handle) {
this.$handleAdd(item, handle[item]);
}
console.log(this.$widgets())
this.$widgets({
audo: ["courses"]
})
this.$refs["ecardEditor"].show();
},
ecardPreviewShow() {
this.$refs["ecardPreview"].show();
},
saveTo (name) {
console.log('saveTo' + name);
},
save () {
console.log('save')
},
exit () {
console.log('exit')
},
setPicture () {
this.$refs["ecardEditor"].setPicture("/213/1245/46.png");
},
setAudio () {
this.$refs["ecardEditor"].setAudio("/213/1245/46.mp3");
},
setVideo () {
this.$refs["ecardEditor"].setVideo("/213/1245/46.mp4");
},
setTemplate () {
this.$refs["ecardEditor"].setTemplate(
[
this.template1,
this.template2
]
);
}
this.code = {
"background":"#ff8040",
"sound":"",
"options":{},
"widgets":[]
};
this.template1 = {
"code": this.code,
"creator":1,
"id":13,
"name":"通知模板"
}
this.template2 = {
"code": this.code,
"creator":1,
"id":14,
"name":"测试模板"
}
this.template = {};
1.0.0
4 years ago