angular应用,请问如何使能够直接在 html 中使用jquery获取元素并作为参数传入函数呢?
<button ng-click="vm.getButton($(this))"></button>
var ctrl = this;
ctrl.getButton = (elem) => {
console.log(elem);
};
函数里面的 this
直接指向了当前scope,无法获取到元素,请问有解吗?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
目前通过下面的方式实现了需求