Skip to content
New issue

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

组件中this.data提示不存在 #282

Open
seanxlliu opened this issue Mar 23, 2023 · 0 comments
Open

组件中this.data提示不存在 #282

seanxlliu opened this issue Mar 23, 2023 · 0 comments

Comments

@seanxlliu
Copy link

#169 已经关闭,但是类似的复现如下

index.ts

    methods: {
        onChange(e: { detail: { value: any; }; }) {
            this.setData({ value: e.detail.value });  // ts(2339) 报错
        },
        handleChange(e) {
            this.setData({ // ts(2339) 报错
                activeValues: e.detail.value,
            });
        },
    },
    lifetimes: {
        attached() {
        }
    },

eslintrc.js

/*
 * Eslint config file
 * Documentation: https://eslint.org/docs/user-guide/configuring/
 * Install the Eslint extension before using this feature.
 */
module.exports = {
  env: {
    es6: true,
    browser: true,
    node: true,
  },
  parserOptions: {
    ecmaVersion: 2018,
    sourceType: 'module',
  },
  globals: {
    wx: true,
    App: true,
    Page: true,
    getCurrentPages: true,
    getApp: true,
    Component: true,
    requirePlugin: true,
    requireMiniProgram: true,
  },
  // extends: 'eslint:recommended',
  parser: "@typescript-eslint/parser",
  plugins: ["@typescript-eslint"],
  rules: {
    semi: ['error', 'never']
  },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant