mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-09 04:31:35 +08:00
refactor(code): add code tag in it
This commit is contained in:
parent
aa567bd1f2
commit
ea8ae121a4
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user