V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
M003
V2EX  ›  问与答

vue 项目如何用油猴调试(模拟登录)

  •  
  •   M003 · Apr 14, 2023 · 1566 views
    This topic created in 1111 days ago, the information mentioned may be changed or developed.

    原生 js/jq

    1. input 一个 value 值
    2. 获取登录按钮 click()
    3. 当点击后是 从 input 元素获取 value 就可以获取到.

    vue 项目

    • 现在直接给 input 上 value 赋值没用.
    1. 获取登录按钮 click()
    2. 这时候 js 获取 value 值是从 js 中的变量获取,而不是 dom 中的属性值

    • 不知道如何给变量赋值,大家是如何操作的.
    4 replies    2023-04-14 15:54:15 +08:00
    hellodigua
        1
    hellodigua  
       Apr 14, 2023
    这种 MVVM 模型的,真实数据都在 Model 层的,所以你给 input 赋值没用,得用事件触发 input 的 focus 事件,然后模拟输入才行
    Carseason
        2
    Carseason  
       Apr 14, 2023
    xpath?
    David1119
        3
    David1119  
       Apr 14, 2023
    puppeteer ,playwright
    Puteulanus
        4
    Puteulanus  
       Apr 14, 2023
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5501 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 08:47 · PVG 16:47 · LAX 01:47 · JFK 04:47
    ♥ Do have faith in what you're doing.