Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import { Directives } from './types/directives'
import { modules, Modules } from './store'
import { setTheme } from './utils'
import { Loading, Message, MessageBox, Notification } from './plugins/elementUI'
import { SDialogMixin } from './mixins'

const components = [
{ component: SApp, name: Components.SApp },
Expand Down Expand Up @@ -177,6 +178,7 @@ export {
STabs,
STable,
STableColumn,
STooltip
STooltip,
SDialogMixin
}
export default SoramitsuElements
23 changes: 23 additions & 0 deletions src/mixins/SDialogMixin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { Vue, Component, Prop, Watch } from 'vue-property-decorator'

@Component
export default class SDialogMixin extends Vue {
/**
* Dialog visibility
*
* `false` by default
*/
@Prop({ type: Boolean, default: false, required: true }) readonly visible!: boolean

isVisible = this.visible

@Watch('visible')
public handleVisibleChange (value: boolean): void {
this.isVisible = value
}

@Watch('isVisible')
public handleIsVisibleChange (value: boolean): void {
this.$emit('update:visible', value)
}
}
9 changes: 9 additions & 0 deletions src/mixins/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import SDialogMixin from './SDialogMixin'
import BorderRadiusMixin from './BorderRadiusMixin'
import SizeMixin from './SizeMixin'

export {
SDialogMixin,
BorderRadiusMixin,
SizeMixin
}