JSFiddle - React, Tailwind, and code Playground
by leopoldthecuber
HTML
<script src="//unpkg.com/vue/dist/vue.js"></script>
<script src="//unpkg.com/element-ui/lib/index.js"></script>
<div id="app">
<template>
<el-button type="text" @click="open3">点击打开 Message Box</el-button>
</template>
</div>
SCSS
@import url("//unpkg.com/element-ui/lib/theme-default/index.css");
Babel + JSX
var Main = {
methods: {
open3() {
this.$prompt('请输入邮箱', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
}).then(({ value }) => {
console.log(a);
}).catch(() => {
this.$message({
type: 'error',
message: 'error catched'
});
});
}
}
}
var Ctor = Vue.extend(Main)
new Ctor().$mount('#app')