gpt4 book ai didi

slim :引用未定义

转载 作者:行者123 更新时间:2023-12-05 00:40:18 24 4
gpt4 key购买 nike

我正在使用 Svelte (v2.7) 和 Sapper (v0.12)。根据the docs , this.refs 应该可用,但对我来说它是 undefined,在 oncreate 和自定义方法中。

我的 index.html 看起来像这样:

<select id="wifi-ssid" ref="wifi-ssid">
...

<script>
export default {
oncreate() {
console.log('this.refs is undefined here', this.refs);
},
methods: {
getIsValid() {
console.log('this.refs is undefined here too', this.refs);
// ...
},
// ...
}
};
</script>

(Full code here)。

我假设这不是一个错误(否则每个人都会遇到它?)而且我有问题,因为这是我第一次使用它。

最佳答案

这已被弃用,我相信新语法是 <select bind:this={wifissid}>

关于 slim :引用未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50723487/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com