recently added Wechat login function, the project is created through create-react-app, similar to
1 in the following figure, how should js be referenced? Can the sections of
2 and js be written directly into Component?
recently added Wechat login function, the project is created through create-react-app, similar to
1 in the following figure, how should js be referenced? Can the sections of
2 and js be written directly into Component?
scriptjs
to directly reference a third party js, in component, such as: import $script from 'scriptjs'
$script('xxx.js', function () {
console.log('load xxx.js success')
})
export default class Catalogue extends Component {
...
}
can be introduced directly into index.html.
Wechat has a npm package for wx-jssdk, which is loaded into the project, import, directly and then use it according to the documentation
.