Giter VIP home page Giter VIP logo

Comments (3)

dntzhang avatar dntzhang commented on July 21, 2024

不能直接改data的方法,需要使用store.method传入path和方法改

纯组件的store和全局的store不是同一个

3是正常现象

4没看懂

from westore.

xmsz avatar xmsz commented on July 21, 2024

不好意思 周末回复晚了
1、这是我的store文件

export default {
  data: {
    user_info: {}, 
    user_coin: function() {
      return this["user_info"]["coin"] || 0;
    }
  },
  globalData: [
    "user_info",
    "user_coin",
  ],
  /**
   * @name 打开授权弹层
   */
  authPopOpen: function() {
    this.data.auth_pop["enable"] = true;
  },
  /**
   * @name 获取用户新手教程状态
   */
  getUserStep: async function() {
    let _step = 0;
    !this.data["user_info_loaded"] && (await getUserInfo());
    _step = this.data["user_info"]["step"];
    return Promise.resolve(_step);
  }

请问authPopOpengetUserStep是属于store.method吗

2、明白了,就是这里store是组件内,不影响其他组件
3、请问这个为什么里面要不一样哈
4、这个我找时间上传代码看看哈

from westore.

dntzhang avatar dntzhang commented on July 21, 2024

authPopOpen 和 getUserStep 不属于,user_coin 属于

from westore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.