Skip to content

Commit a939700

Browse files
committed
package updated
1 parent d702506 commit a939700

File tree

5 files changed

+66
-70
lines changed

5 files changed

+66
-70
lines changed

components/Step/Markdown.vue

+15-10
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,25 @@ export default {
2929
}
3030
},
3131
mounted() {
32-
// Add copy button component in each pre element
33-
setTimeout(function () {
34-
const blocks = document.querySelectorAll("pre.hljs")
35-
for (const block of blocks) {
36-
const CopyButton = Vue.extend(AppCopyButton)
37-
const component = new CopyButton().$mount()
38-
block.appendChild(component.$el);
39-
}
40-
}, 250)
32+
const blocks = document.querySelectorAll("pre.hljs")
33+
for (const block of blocks) {
34+
const CopyButton = Vue.extend(AppCopyButton)
35+
const component = new CopyButton().$mount()
36+
block.appendChild(component.$el);
37+
}
38+
},
39+
updated() {
40+
const blocks = document.querySelectorAll("pre.hljs")
41+
for (const block of blocks) {
42+
const CopyButton = Vue.extend(AppCopyButton)
43+
const component = new CopyButton().$mount()
44+
block.appendChild(component.$el);
45+
}
4146
},
4247
computed: {
4348
markdown() {
4449
let mode, wrapBody = this.step.body;
45-
if (process.client == true) {
50+
if (process.client === true) {
4651
mode = this.detectMode(this.step.title)
4752
4853
}

0 commit comments

Comments
 (0)