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

vue项目如何导入webF #12

Open
fghjhuang opened this issue Sep 24, 2024 · 0 comments
Open

vue项目如何导入webF #12

fghjhuang opened this issue Sep 24, 2024 · 0 comments

Comments

@fghjhuang
Copy link

看到:Dart and JS Intercommunication这个章节,之前vue create的项目,导入:

webf.methodChannel.addMethodCallHandler('setPlayerState', function(state) {
  // Here, 'state' holds the data sent from Dart.

  // You can use the 'state' as needed in your JavaScript logic.
  this.playerState = state;

  // If there's a listener setup for player state changes, notify it.
  if (typeof this.onPlayerStateChanged === 'function') {
    this.onPlayerStateChanged(this.playerState);
  }
  
  // You can also send back a response to Dart, if needed.
  return 'Received state: ' + state;
});

然后vue build, 一直报错can not find webf, 需要导入webf的vue库么?还是webf.js?应该在哪里导入?

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