Release.vue 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <el-dialog
  3. title="更新日志"
  4. :visible.sync="visible"
  5. width="800px"
  6. @close="visible=false">
  7. <div
  8. ref="content"
  9. id="release">
  10. </div>
  11. <span slot="footer">
  12. <el-button @click="visible = false">取消</el-button>
  13. <el-button
  14. type="primary"
  15. @click="visible = false">确定</el-button>
  16. </span>
  17. </el-dialog>
  18. </template>
  19. <script>
  20. export default {
  21. data () {
  22. return {
  23. visible: false,
  24. htmlData: ''
  25. }
  26. },
  27. mounted () {
  28. },
  29. methods: {
  30. render () {
  31. this.visible = true
  32. const logPath = require('path').join(__static, 'CHANGELOG.md')
  33. const content = require('fs').readFileSync(logPath, 'utf-8')
  34. this.$nextTick(() => {
  35. this.$refs.content.innerHTML = require('marked')(content).replace(/<\/?a.*?>/g, '')
  36. })
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss">
  42. @import './release.scss';
  43. </style>