|
楼主 |
发表于 2019-7-23 14:59:26
|
显示全部楼层
<template>
<div><a-button type="primary">确定</a-button></div>
</template>
<script>
import moment from 'moment'
import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types'
export default {
name: 'TestModal',
data() {
return {
headers: {},
//form: this.$form.createForm(this),
drawerWidth:700,
visible: false
}
},
created() {
const token = Vue.ls.get(ACCESS_TOKEN)
this.headers = { 'X-Access-Token': token }
console.log("created")
},
methods: {
show:function() {
console.log("show");
this.visible=true;
}
}
}
</script>
<style scoped>
</style>
以上是我写的一个组件
在UserList.vue里调用
<test_modal ref="testModal"></test_modal>
import UserModal from './modules/UserModal'
components: {
SysUserAgentModal,
UserModal,
PasswordModal,
TestModal
},
都 有了
调用方法:
this.$refs.testModal.show();
但是显示那个错误。 |
|