1234567891011121314151617181920212223242526272829303132333435363738 |
- import { getAnswerPointImg } from "../utils";
- export async function answerPointHandle() {
- this.$refs.editor.focus();
-
-
-
-
- const node = document.createElement("img");
- node.src = getAnswerPointImg("X");
- node.dataset.isAnswerPoint = true;
- node.dataset.isAnswerPointX = true;
- node.dataset.order = 0;
- document.execCommand("insertHTML", false, node.outerHTML);
- }
- export async function answerPointRebuild() {
- const answerPoints = this.$refs.editor.querySelectorAll(
- "[data-is-answer-point]"
- );
- [...answerPoints].forEach((answerPoint, index) => {
- answerPoint.dataset.order = index + 1;
- answerPoint.src = getAnswerPointImg(index + 1);
- });
- }
|