import { createApp } from 'vue'
import App from './App.vue'
import router from "./router/index";
import ElementPlus from 'element-plus';
import 'element-plus/lib/theme-chalk/index.css';
createApp(App).use(router).use(ElementPlus).mount('#app')
import { onMounted,reactive,ref,toRefs,getCurrentInstance} from 'vue'
export default {
setup(){
const submitForm = formName => {
if(loginForm.user==""){
let {ctx} = getCurrentInstance();
ctx.$alert('对不起,账号不能为空', '提示', {
confirmButtonText: '确定',
callback: action => {
}
});
return
}
if(loginForm.password==""){
ctx.$alert('对不起,密码不能为空', '提示', {
confirmButtonText: '确定',
callback: action => {
}
});
return
}
router.push("/home");
}
}
}
这篇主要讲的还是 element-plus 怎么用。
let {proxy} = getCurrentInstance();