Commit a95968a7 by luyt

feat:GLVideo补全文档,组件

1 parent 63548dd1
......@@ -79,6 +79,10 @@
title: 'GLDrawer',
link: '/components/GLDrawer'
},
{
title: 'GLVideo(1.5.5+)',
link: '/components/GLVideo'
},
]
},
{
......
......@@ -244,6 +244,15 @@
<span>我来啦!</span>
</GLDrawer>
<hr />
<!-- 测试GLVideo -->
<h3>GLVideo</h3>
<el-button type="primary" @click="isVideoShow = true">打开视频</el-button>
<GLVideo :videoShow.sync="isVideoShow">
<template v-slot:title>
hello world
</template>
</GLVideo>
<hr />
</div>
</template>
<script>
......@@ -926,7 +935,10 @@ export default {
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}
]
],
// 测试GLVideo视频播放
isVideoShow:false
}
},
mounted() {
......
......@@ -20,6 +20,7 @@ import {
GLTableOption,
GLImage,
GLDrawer,
GLVideo,
// 业务
GLProvince,
GLBcTest,
......@@ -52,3 +53,4 @@ Vue.use(GLTabs)
Vue.use(GLTableOption)
Vue.use(GLImage)
Vue.use(GLDrawer)
Vue.use(GLVideo)
\ No newline at end of file
import GLVideo from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLVideo.install = function(Vue) {
Vue.component(GLVideo.name, GLVideo)
}
// 默认导出组件
export default GLVideo
\ No newline at end of file
<!-- <content> -->
<el-button type="primary" @click="handleVideoShow">打开视频</el-button>
<GLVideo :videoShow.sync="isVideoShow">
<template v-slot:title>
hello world
</template>
</GLVideo>
<el-button type="warning" @click="toggleShow(1)">显示代码</el-button>
```js {mixin:true}
{
data() {
return {
demo1:true,
isVideoShow: false
}
},
methods:{
btnClick(){
alert('点击')
},
toggleShow(num){
// console.log(123)
this['demo' + num] = !this['demo' + num]
},
handleVideoShow(){
this.isVideoShow = true;
}
}
}
```
# 用来作为 markdown 代码的示例部分
<div v-if="demo1">
```html
<template>
<GLVideo :videoShow.sync="isVideoShow">
<template v-slot:title>
hello world
</template>
</GLVideo>
</template>
<script>
export default {
data() {
return {
isVideoShow: false
}
}
}
</script>
```
</div>
<!-- </content> -->
<template>
<el-dialog class="gl-video" :visible="videoShow" width="50%" @close="handleClose">
<div slot="title" class="video-title">
<!-- title插槽 -->
<slot name="title"></slot>
</div>
<!-- <video v-if="videoShow" width="100%" height="100%" autoplay controls src="https://img02.glsx.com.cn/scrm/video/beforeSale.mp4"></video> -->
<video v-if="videoShow" :width="videoWidth" :height="videoHeight" :src="videoSrc" autoplay controls v-bind="$attrs">
您的浏览器不支持 video 标签。
</video>
</el-dialog>
</template>
<script>
export default {
name: 'GLVideo',
props: {
// 显示隐藏(.sync)
videoShow: {
type: Boolean,
default: false
},
// 视频的地址
videoSrc: {
type: String,
default: 'https://img02.glsx.com.cn/scrm/video/beforeSale.mp4'
},
// 视频的宽度(一般不设置)
videoWidth: {
type: String,
default: '100%'
},
// 视频的高度(一般不设置)
videoHeight: {
type: String,
default: '100%'
}
},
data() {
return {
//
}
},
mounted() {
//
},
methods: {
handleClose() {
this.$emit('update:videoShow', false)
}
}
}
</script>
<style lang="scss">
.gl-video {
.video-title{
height: 25px;
line-height: 25px;
font-size:20px;
font-weight: 500;
color: #fff;
}
.el-dialog__header {
border-bottom: none;
background-color: #000;
.el-dialog__headerbtn {
top: 15px;
font-size: 24px;
}
}
.el-dialog__body {
padding: 0;
display: flex;
}
}
</style>
......@@ -184,6 +184,9 @@ export default {
.input {
flex: 1;
// width:100%;
.el-range-editor.el-input__inner{
padding: 2px 3px 0 3px;
}
}
.el-input {
width: 100%;
......
......@@ -25,6 +25,7 @@ import GLTabs from './GLTabs'
import GLTableOption from './GLTableOption'
import GLImage from './GLImage'
import GLDrawer from './GLDrawer'
import GLVideo from './GLVideo'
// 导入业务组件
import GLProvince from './GLProvince'
......@@ -40,7 +41,7 @@ const ElComponent = [Table, TableColumn, Popover, Button, ButtonGroup, Loading,
const BcComponent = [GLBcTest]
// 存储组件列表
const components = [TestComp, GLExternal, GLButton, GLDialog, GLTable, GLFooter, GLSearch, GLSearchItem, GLCombiForm, GLTableButton, GLProvince, GLFull, GLEditor, GLTabs,GLTableOption,GLImage,GLDrawer].concat(ElComponent).concat(BcComponent)
const components = [TestComp, GLExternal, GLButton, GLDialog, GLTable, GLFooter, GLSearch, GLSearchItem, GLCombiForm, GLTableButton, GLProvince, GLFull, GLEditor, GLTabs,GLTableOption,GLImage,GLDrawer,GLVideo].concat(ElComponent).concat(BcComponent)
// console.log('components: ', components);
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
......@@ -96,6 +97,7 @@ export default {
GLTableOption,
GLImage,
GLDrawer,
GLVideo,
//业务组件
GLProvince,
GLBcTest,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!