We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
san-ssr@5.1.0和@4.9.2在computed取值数组this.data.get()失败
state结构
initData() { return { data1: { data2: { schoolAge: 9, }, data3: [ { age: 9, } ] }, }; }
在computed里,数组下标取值
import {Component} from 'san'; class Demo extends Component { static template = /* html */ ` <div class="{{styles.fsDynamic}}"> 学龄为{{schoolAge}};<br/> 年龄为{{age}}; </div> `; static computed: I.Computed = { schoolAge() { const schoolAge = this.data.get('data1.data2.schoolAge'); console.log('computing schoolAge', schoolAge); return schoolAge; }, age() { const age = this.data.get('data1.data3[0].age'); console.log('computing age', age); return age; } }; initData() { return { data1: { data2: { schoolAge: 9, }, data3: [ { age: 9, } ] }, }; } } // 渲染结果能得到schoolAge,得不到age // 学龄为9;年龄为;
Versions
The text was updated successfully, but these errors were encountered:
feat: support [] while calling data methods
f5d7181
fix: #145
30fd0dd
chore(release): 5.2.0 [skip ci]
e729de4
# [5.2.0](v5.1.0...v5.2.0) (2022-04-18) ### Bug Fixes * revert "computed 应该在 inited 之前调用" [#144](#144) ([2b80c02](2b80c02)) * 根组件有 if 指令时,没有输出数据 [#146](#146) ([30b7f1c](30b7f1c)) ### Features * support [] while calling data methods ([30fd0dd](30fd0dd)), closes [#145](#145)
🎉 This issue has been resolved in version 5.2.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
san-ssr@5.1.0和@4.9.2在computed取值数组this.data.get()失败
state结构
在computed里,数组下标取值
Versions
The text was updated successfully, but these errors were encountered: