我只是想$refs在我的 Vue 3 应用程序中使用,但我一直收到 Typescript 错误Object is of type 'unknown'。我不知道如何解决这个问题。
这是我的 .vue 文件:
<template>
<div id="content">
<h2>
Add Products
</h2>
<Multiselect v-model="products"
mode="tags"
placeholder="Select one or more products..."
ref="multi"
:searchable="true"
:createTag="true"
:options="options"></Multiselect>
<div v-for="(product, index) in this.products"
v-bind:key="index"
v-bind:name="product">
<Button class="primary"
text="Remove"
@click="removeProduct(product)"></Button>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
import Button from '@/components/Button.vue'
import Multiselect from '@vueform/multiselect'
export default defineComponent({
name: 'TrackSymptoms',
components: {
Button,
Multiselect
},
data () {
return …Run Code Online (Sandbox Code Playgroud) <script context="module">
import GhostContentAPI from '@tryghost/content-api';
// const api = 'http://localhost/posts';
const api = new GhostContentAPI({
url: 'http://localhost',
key: '95a0aadda51e5d621abd2ee326',
version: "v3"
});
export async function preload({ params, query }) {
try {
const response = await api.posts.browse({ limit: 5, fields: 'title, slug' });
return {
posts: response
}
} catch(err) {
console.log('Error');
}
}
</script>
<script>
export let posts;
</script>
<svelte:head>
<title>Blog</title>
</svelte:head>
<h1>Recent posts</h1>
<ul>
{#each posts as post}
<li>
<a rel='prefetch' href='blog/{post.slug}'>{post.title}</a>
</li>
{/each}
</ul>
Run Code Online (Sandbox Code Playgroud)
我正在使用 vanilla …
我无法通过 WebRTC 视频和音频远程连接到我的本地对等方。此问题仅在桌面和 iOS 上的 Safari 中发生。在 Chrome 和 Firefox 上,这个问题不存在。
我假设它与 Safari 中的事实有关,它总是询问您是否要允许音频/视频,但我不确定。这只是我可以在浏览器之间做出的唯一区别。即使在选择“允许”后,问题仍然存在。
繁殖步骤:
结果:
new. 请参阅以下 RTCPeerConnection 对象:这是通过完全相同的步骤获得的完全相同的对象,但在 Chrome 或 Firefox 中:
编辑:
经过更多测试,我发现了以下内容:
以下格式:(第一次连接)>(第二次连接)
Chrome > Chrome:有效
Chrome > Firefox:有效
Chrome > Safari:不起作用
Safari > Chrome:有效
Safari > Safari:有效
将 Safari 用于连接的双方时似乎不存在此问题……仅当 Safari 用作辅助连接时。
这是我的代码:
import h from './helpers.js';
document.getElementById('close-chat').addEventListener('click', (e) => {
document.querySelector('#right').style.display = "none";
});
document.getElementById('open-chat').addEventListener('click', (e) => {
document.querySelector('#right').style.display = "flex";
});
window.addEventListener('load', …Run Code Online (Sandbox Code Playgroud) javascript ×2
ghost-blog ×1
safari ×1
sapper ×1
sockets ×1
svelte ×1
typescript ×1
vue.js ×1
vuejs3 ×1
webrtc ×1