Use vue+typescript to build a project, and after introducing weixin-js-sdk, you can't use the methods inside?

problem description

use vue+typescript "s vue-cli3.0 to build a project and want to share with Wechat. After introducing weixin-js-sdk, import wx from "weixin-js-sdk" in the page. As a result, underfined, is displayed when wx is printed, but in the same way used in vue-cli2.0, normal objects can be printed

.

related codes

import wx from "weixin-js-sdk";
export default class Index extends Vue {
mounted () {

console.log(wx);

}
}

sources of topics and their own ideas

this question has perplexed me for several days. Today, I just found out that it is the problem of cli3.0. I am not very familiar with TS. I am looking for help from God to answer this question. Thank you!

Aug.07,2021

const wx = window ['wx']


const wx: any = (' wx' in window) & & window ['wx']

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea8507-47c8c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea8507-47c8c.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?