# Vue网站书签栏脚本小技巧

{% embed url="<https://v.douyin.com/r6g752H/>" %}

{% embed url="<https://www.bilibili.com/video/BV1oY4y1s7Kp/>" %}

我们在书签栏里写脚本的时候

如果碰到这种Vue的网站

比如说这个文本框

大家看啊

即使我给他赋了值

系统也会认为他是空的

大家看

所以每次啊我们都需要

在这编辑一下

再删掉这样才行

大家看

那怎么解决呢

我们可以在这个脚本里加一句代码

我把它复制出来在这编辑

嗯这个是赋值的那个dom节点

我们把它复制一下在后面

大家看 在赋值成功以后哈

我们再点 dispatch

调用它的Event

然后 new 一个 Event

里边 传 input

好我们再把它放回去

ok 清空一下

我们再来试一下哈

然后这个表单验证先不用管他

我直接点创建

大家看就可以提交了

好这样就可以了


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sunzsh.gitbook.io/xiaoshan.bug/vue-wang-zhan-shu-qian-lan-jiao-ben-xiao-ji-qiao.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
