弹窗
This commit is contained in:
41
src/components/dialog.vue
Normal file
41
src/components/dialog.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="active" class="dialog_wrapper">
|
||||
<div class="dialog">
|
||||
<div class="dialog_header">
|
||||
<span class="dialog_title">{{title}}</span>
|
||||
<button class="dialog_headerbtn" @click="toCancle">
|
||||
<i class="iconfont icon_close"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="dialog_body">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<div class="dialog_footer">
|
||||
<button class="button button--primary" @click="toCancle">取消</button>
|
||||
<button class="button button--primary">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="active" class="modal"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'jxDialog',
|
||||
props: {
|
||||
title: String
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
active: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toCancle () {
|
||||
this.active = false
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user