Skip to content

Commit 51e3e04

Browse files
authored
Merge pull request #287 from Tofandel/patch-1
fix(reactivity): correctly trigger content update if prop changes
2 parents f19a1d7 + c2544cb commit 51e3e04

File tree

8 files changed

+4101
-3322
lines changed

8 files changed

+4101
-3322
lines changed

demo/package-lock.json

Lines changed: 1428 additions & 1208 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
},
99
"dependencies": {
1010
"quill-blot-formatter": "^1.0.5",
11-
"vue": "^3.0.5"
11+
"vue": "^3.2.41"
1212
},
1313
"devDependencies": {
14-
"@vitejs/plugin-vue": "^1.2.1",
15-
"@vue/compiler-sfc": "^3.0.5",
16-
"typescript": "^4.1.3",
17-
"vite": "^2.1.5",
18-
"vue-tsc": "^0.0.15"
14+
"@vitejs/plugin-vue": "^3.2.0",
15+
"@vue/compiler-sfc": "^3.2.41",
16+
"typescript": "^4.9.3",
17+
"vite": "^3.2.4",
18+
"vue-tsc": "^1.0.9"
1919
}
2020
}

demo/src/assets/logo.png

-6.69 KB
Binary file not shown.

demo/src/examples/ContentType.vue

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
11
<template>
22
<h1>Content Type</h1>
3-
<QuillEditor v-model:content="contentDelta" contentType="delta" />
3+
<QuillEditor
4+
v-model:content="contentDelta"
5+
content-type="delta"
6+
/>
47
<pre>{{ contentDelta }}</pre>
5-
<QuillEditor v-model:content="contentHTML" contentType="html" />
8+
<QuillEditor
9+
v-model:content="contentHTML"
10+
content-type="html"
11+
/>
612
<pre>{{ contentHTML }}</pre>
7-
<QuillEditor v-model:content="contentText" contentType="text" />
13+
<QuillEditor
14+
v-model:content="contentText"
15+
content-type="text"
16+
/>
817
<pre>{{ contentText }}</pre>
18+
<button
19+
type="button"
20+
@click="update"
21+
>
22+
Trigger external content update
23+
</button>
924
</template>
1025

1126
<script lang="ts">
@@ -27,7 +42,17 @@ export default defineComponent({
2742
const contentHTML = ref('<h1>This is html header</h1>')
2843
const contentText = ref('This is just plain text')
2944
30-
return { contentDelta, contentHTML, contentText }
45+
const update = () => {
46+
contentDelta.value = new Delta([
47+
{ insert: 'Gandalf', attributes: { bold: true } },
48+
{ insert: ' the ' },
49+
{ insert: 'White', attributes: { color: '#fff', background: '#000' } },
50+
]);
51+
contentHTML.value = '<h3>This is a different HTML header</h3>';
52+
contentText.value = 'This is some more plain text';
53+
}
54+
55+
return { contentDelta, contentHTML, contentText, update }
3156
},
3257
})
3358
</script>

demo/tsconfig.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
{
32
"compilerOptions": {
43
"target": "esnext",
@@ -11,10 +10,12 @@
1110
"esModuleInterop": true,
1211
"lib": ["esnext", "dom"],
1312
"types": ["vite/client"],
14-
"rootDir": ".",
13+
"rootDir": "..",
14+
"baseUrl": ".",
1515
"paths": {
1616
"@vueup/*": ["../packages/*/src"]
17-
}
17+
},
18+
"skipLibCheck": true
1819
},
1920
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
2021
}

0 commit comments

Comments
 (0)