123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <template>
- <ui-dialog>
- <template v-slot:header>
- <span>{{ title }}</span>
- <i class="iconfont icon-close fun-ctrl" @click="close"></i>
- </template>
- {{ content }}
- <template v-slot:footer>
- <ui-button type="submit" @click="close">{{ okText }}</ui-button>
- </template>
- </ui-dialog>
- </template>
- <script>
- import { defineComponent } from "vue";
- import { isFunction, omit } from "../../utils";
- import { ui18n } from "@/lang";
- export default defineComponent({
- name: "ui-alert",
- props: {
- title: {
- type: String,
- default: ui18n.t('sys.tip'),
- },
- okText: {
- type: String,
- default: ui18n.t('sys.enter'),
- },
- func: Function,
- content: String,
- destroy: Function,
- },
- setup: function (props, ctx) {
- const close = () => {
- if (isFunction(props.func) && props.func() === false) {
- return;
- }
- isFunction(props.destroy) && props.destroy();
- };
- return {
- ...omit(props, "destroy", "func"),
- close,
- };
- },
- });
- </script>
|