目前分類:Web (11)
- Dec 17 Tue 2024 13:54
Vue專案部屬於Azure static App上
- Nov 25 Mon 2024 10:08
Line Id轉換成Url,可以自行帶入查詢
- Jun 23 Thu 2022 17:00
introjs網站導覽功能
- Jun 22 Wed 2022 17:00
Vuetify 表單驗證簡易說明
- Jun 21 Tue 2022 21:31
頁面閱讀光條
- May 31 Tue 2022 22:42
vue3 wangeditor3.0 版本 光標跳到最後問題
最近遇到一個問題,在使用vue3的wangeditor3.0 ,發現在輸入文字後,文字的光標會自行的跳到最後一個字,導致打字非常麻煩
<template> <div class="editor-container"> <div :id="id"></div> </div> </template> <script lang="ts"> import { toRefs, reactive, onMounted, watch } from 'vue'; import wangeditor from 'wangeditor'; export default { name: 'wngEditor', props: { id: { type: String, default: () => 'wangeditor', }, // 是否禁用 isDisable: { type: Boolean, default: () => false, }, // 雙像綁定 // 参考:https://v3.cn.vuejs.org/guide/migration/v-model.html#%E8%BF%81%E7%A7%BB%E7%AD%96%E7%95%A5 modelValue: String, }, setup(props, { emit }) { const state = reactive({ editor: null, isChanged : false, }); // 初始化 // https://doc.wangeditor.com/ const initWangeditor = () => { state.editor = new wangeditor(`#${props.id}`); state.editor.config.placeholder = '請輸入內容'; state.editor.config.uploadImgShowBase64 = true; state.editor.config.showLinkImg = false; onWangeditorChange(); state.editor.create(); state.editor.txt.html(props.modelValue); props.isDisable ? state.editor.disable() : state.editor.enable(); }; // 内容改變時 const onWangeditorChange = () => { state.editor.config.onchange = (html: string) => { state.isChanged = true; //標記改變 emit('update:modelValue', html); }; }; // 監聽雙像綁定值 // https://gitee.com/lyt-top/vue-next-admin/issues/I4LM7I watch( () => props.modelValue, (value) => { if(!state.isChanged) state.editor.txt.html(value); state.isChanged = false; } ); onMounted(() => { initWangeditor(); }); return { ...toRefs(state), }; }, }; </script>
- May 23 Mon 2022 22:30
IdentityServer4 in Vue3
最近開始使用open ID進行驗證認證 , 我在找尋解決方案時發現了identityserver4 得這個集大成的open ID使用 套件 , 切可以很方便擴展公司內部所使用的AD認證 或者是Google認證LINE認證等方式, 那我們就開始簡單的介紹一下identityserver4實作的方式。
- May 28 Thu 2020 10:08
[JS] EasyUI Combobox require 擴展方法
- May 25 Mon 2020 23:34
Web deployment task failed. ('Microsoft.Web.Deployment.DeploymentManager' 的類型初始設定式發生例外狀況。)
今天重灌VS2019在發不時發生以下錯誤訊息
Web deployment task failed. ('Microsoft.Web.Deployment.DeploymentManager' 的類型初始設定式發生例外狀況。)
- May 11 Mon 2020 09:42
[JS] 防止事件多次累加
- Apr 10 Tue 2018 23:21
[MVC] 多個Model在同一個View中顯示範例