api-typings icon indicating copy to clipboard operation
api-typings copied to clipboard

组件中this.data提示不存在

Open seanxlliu opened this issue 2 years ago • 0 comments
trafficstars

#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']
  },
}

seanxlliu avatar Mar 23 '23 08:03 seanxlliu