我创建了一个这样的组件:
<template>
<span class="my-icon">
<img :src="iSrc" :alt="iname"/>
</span>
</template>
<script>
export default {
props: ['iname'],
computed: {
iSrc() {
return require('../../../assets/images/' + this.iname + '.png')
}
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
在这样的页面中使用它:
<template>
<div>
<h3>Share it:</h3>
<social-sharing inline-template network-tag="a">
<div class="my-icons">
<network network="facebook" class="fb-icon">
<icon name="fb" />
</network>
</div>
</social-sharing>
</div>
</template>
<script>
import Icon from '~/comps/icon.vue'
export default {
components: {
Icon
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
但它抛出了这个错误:
[Vue警告]:未知的自定义元素: - 您是否正确注册了组件?对于递归组件,请确保提供"名称"选项.
该<social-sharing>组件来自Vue插件.如果我<icon>在<social-sharing>标记之外使用我的组件它可以正常工作,但它内部会抛出错误.
我有一个 vue 文件
// myComponent.vue
import { something } from 'some-module'
...
Run Code Online (Sandbox Code Playgroud)
我想将此导入语句替换为
import { something } from '@/utils/myModule'
Run Code Online (Sandbox Code Playgroud)
以防运行 vitest 命令时。我们有一些插件可以用来获得上述结果吗?
我有一个st从Web服务返回的字符串.我将字符串转换为对象,我如何计算否.里面的数组?(对于这种情况,它是2)
var st = "{[{"Name": "fake", "Address": "add"]},[{"Name": "fake", "Address": "add"}]}";
var json = eval(st);
Run Code Online (Sandbox Code Playgroud)
json.length总是回归1
我从数据库中获取内容.如何使用部分视图使用该数据库在页面上显示内容?
数据库表:内容
[Id,Content]这些是2个字段
我想使用部分视图从db获取内容.
我如何将id传递给局部视图并在视图页面中显示内容?
我创建了一个三个文件SettingsViewController.h,SettingsViewController.m和SettingsViewController.xib.
我在单击一行中的单元格时显示SwttingsViewController.xib.xib文件上有一个标签和滑块.它工作正常.但在使用界面构建器创建连接后.即从redLabel插槽拖放到我在xib文件上的Label我收到此错误并且应用程序终止.
'[<UIViewController 0x3d636d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key redLabel."
如何查找字符串数组是否包含字符串的某些部分?我有这样的数组
String[] stringArray = new [] { "abc@gmail.com", "cde@yahoo.com", "@gmail.com" };
string str = "coure06@gmail.com"
if (stringArray.Any(x => x.Contains(str)))
{
//this if condition is never true
}
Run Code Online (Sandbox Code Playgroud)
我想在块中包含一个字符串完全或任何数组的Item的一部分时运行此块.
我在动态创建的按钮上附加了onclick事件,但事件未触发.
var ind = location.href.indexOf('http://www.example.com/');
function init(){
alert('h');
}
if(ind != -1){
var elem = document.createElement("input");
elem.id ='btnGumb';
elem.value = 'Select Check box';
elem.type = 'button';
elem.style.position = 'fixed';
elem.style.left = '0px';
elem.style.top = '0px';
//this is not working
elem.setAttribute('onclick', 'init();');
//but alert is working: elem.setAttribute('onclick', 'alert("h");');
document.body.appendChild(elem);
}
Run Code Online (Sandbox Code Playgroud) 我有2个地方的lat/lon.如何从谷歌地图api获取路线?我想显示地图和路线文字.
我想在google maps v3中完全自定义infowindow?我只是想在那里显示一个图像,没有带箭头的白色圆形背景.
在v3中有可能吗?或任何解决方法?
像这样的东西

javascript ×6
google-maps ×2
asp.net-mvc ×1
c# ×1
canvas ×1
greasemonkey ×1
html5 ×1
iphone ×1
json ×1
objective-c ×1
vite ×1
vuejs2 ×1