refactor(code): add code tag in it

This commit is contained in:
07akioni 2019-12-22 14:10:37 +08:00
parent aa567bd1f2
commit ea8ae121a4

View File

@ -57,9 +57,9 @@ export default {
content content
} = this.generateCodeHTML(this.language, this.code, this.trim) } = this.generateCodeHTML(this.language, this.code, this.trim)
if (valid) { if (valid) {
this.$el.innerHTML = content this.$refs.code.innerHTML = content
} else { } else {
this.$el.textContent = content this.$refs.code.textContent = content
} }
} }
}, },
@ -69,7 +69,11 @@ export default {
class: { class: {
[`n-${this.synthesizedTheme}-theme`]: this.synthesizedTheme [`n-${this.synthesizedTheme}-theme`]: this.synthesizedTheme
} }
}) }, [
h('code', {
ref: 'code'
})
])
} }
} }
</script> </script>