no message
Former-commit-id: f3c11b2f64cc627044be20129050e193a8eec631 Former-commit-id: 49657d956a264020cda5ee3230870cf736197400 Former-commit-id: c3796afffe32e911c917133f2dc804cfe664acd7
This commit is contained in:
48
src/pages/demo/plugins/export/txt.vue
Normal file
48
src/pages/demo/plugins/export/txt.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<Container>
|
||||
<PageHeader
|
||||
slot="header"
|
||||
title="导出文本">
|
||||
</PageHeader>
|
||||
<el-input
|
||||
type="textarea"
|
||||
:autosize="{minRows: 2, maxRows: 4}"
|
||||
placeholder="请输入内容 然后点击保存按钮导出文本文档"
|
||||
v-model="text">
|
||||
</el-input>
|
||||
<div class="dd-mt dd-mb">
|
||||
<el-button type="primary" @click="exportTxt">
|
||||
<Icon name="download"></Icon>
|
||||
保存为 txt
|
||||
</el-button>
|
||||
</div>
|
||||
<Markdown url="/static/md/插件 - 导出.md"></Markdown>
|
||||
</Container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
text: ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
exportTxt () {
|
||||
// 校验是不是空
|
||||
if (this.text === '') {
|
||||
this.$message('虽然可以为空 但是出于体验不建议这样 还是写点东西吧')
|
||||
return
|
||||
}
|
||||
// 导出
|
||||
this.$export.txt({
|
||||
text: this.text,
|
||||
title: '文本'
|
||||
})
|
||||
.then(() => {
|
||||
this.$message('导出文本成功')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user