I have written many components in vuetify that are reusable. I am using jest testing framework for unit testing. When I run 'npm run test', the test fails with 'SyntaxError: Unexpected identifier'.
All my babel config and jest config are in package.json file. When I create a spec file without any vuetify components, test works. But once I add vuetify, it distorts. I first used localValue from @vue/test-utils to consume vuetify. It didn't work. Then I used Vue.use(Vuetify) and still …
我有一个端点,它根据某些参数为我提供图像。这不是一个图像网址,而是一个普通图像。因此,当我到达邮递员中的端点时,作为响应,我收到一张图像(JPG)。
我是否可以在变量中接收该图像并将其绑定到 HTML 标签中?
所有问题都有将图像 url 映射到图像的解决方案,而我的是必须在 UI 中显示的图像。
显示图像组件.ts
this.appservice.getImage().subscribe((image) => {
console.log(image);
}
)
Run Code Online (Sandbox Code Playgroud)
服务.ts
getImg() {
return this.httpClient.get('xyz.com', {headers: this.httpHeaders});
}
Run Code Online (Sandbox Code Playgroud)
我应该如何在 HTML 上显示图像变量中收到的图像?
angular ×1
angular5 ×1
angular6 ×1
babel-jest ×1
html ×1
javascript ×1
jestjs ×1
vue.js ×1
vuetify.js ×1