mirror of
https://github.com/501351981/vue-office.git
synced 2025-07-25 07:41:42 +08:00
fix: excel autoFouce=false
This commit is contained in:
parent
80fdb07cf0
commit
16fe68a26d
File diff suppressed because one or more lines are too long
2
examples/dist/index.html
vendored
2
examples/dist/index.html
vendored
@ -5,7 +5,7 @@
|
||||
<link rel="icon" type="image/svg+xml" href="/vue-office/examples/dist/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Vue</title>
|
||||
<script type="module" crossorigin src="/vue-office/examples/dist/assets/index-e4b65c00.js"></script>
|
||||
<script type="module" crossorigin src="/vue-office/examples/dist/assets/index-5eec29f6.js"></script>
|
||||
<link rel="stylesheet" href="/vue-office/examples/dist/assets/index-e7e9fac4.css">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -1,12 +1,12 @@
|
||||
export function readOnlyInput(ref){
|
||||
let root = ref.value;
|
||||
if(root){
|
||||
|
||||
let nodes = root.querySelectorAll('.hide-input');
|
||||
console.log(nodes);
|
||||
for(let node of nodes){
|
||||
let input = node.childNodes[0];
|
||||
input && (input.readOnly = true);
|
||||
input && !input.readOnly && (input.readOnly = true);
|
||||
}
|
||||
document.activeElement && document.activeElement.blur();
|
||||
}
|
||||
}
|
@ -61,12 +61,16 @@ export default defineComponent({
|
||||
emit('error', e);
|
||||
});
|
||||
}
|
||||
const observerCallback = debounce(readOnlyInput, 20).bind(this,rootRef);
|
||||
const observerCallback = debounce(readOnlyInput, 200).bind(this,rootRef);
|
||||
const observer = new MutationObserver(observerCallback);
|
||||
const observerConfig = { attributes: true, childList: true, subtree: true };
|
||||
onMounted(() => {
|
||||
observer.observe(rootRef.value, observerConfig);
|
||||
observerCallback(rootRef);
|
||||
rootRef.value.addEventListener('focus', ()=>{
|
||||
debugger
|
||||
})
|
||||
|
||||
window.xs = xs = new Spreadsheet(rootRef.value, {
|
||||
mode: 'read',
|
||||
showToolbar: false,
|
||||
|
Loading…
x
Reference in New Issue
Block a user