我的 HTML 代码是这样的:
<a href="#" class="button" data-latLng="53#separator#-1.33#separator#Address 1">Button 1</a>
<a href="#" class="button" data-latLng="-34.397#separator#150.644#separator#Address 2">Button 2</a>
<div id="map-canvas"></div>
Run Code Online (Sandbox Code Playgroud)
我的 Javascript 代码是这样的:
$(document).on("click", ".button", function(e) {
e.preventDefault();
var latLng = $(this).attr("data-latLng");
initialize(latLng);
function initialize(latLng) {
console.log(latLng);
latLng = latLng.split("#separator#");
address = latLng[2];
console.log(address);
var map;
var myCenter=new google.maps.LatLng(latLng[0],latLng[1]);
var marker=new google.maps.Marker({
position:myCenter
});
var mapProp = {
center: myCenter,
zoom: 14,
mapTypeId:google.maps.MapTypeId.ROADMAP
};
map=new google.maps.Map(document.getElementById("map-canvas"),mapProp);
marker.setMap(map);
...
};
...
});
Run Code Online (Sandbox Code Playgroud)
演示是这样的:https : //jsfiddle.net/oscar11/b0ahcLxw/
我想在标记谷歌地图中显示地址,但我仍然很困惑。因此,当单击按钮时,地图会自动在标记上显示地址。
有什么解决方案可以解决我的问题?
非常感谢
我添加数据的表格是这样的:
当点击保存时,它会调用控制器
我的控制器是这样的:
public function store(Request $request)
{
$param = $request->only('account_name','account_number','bank_id','branch');
$result = $this->user_service->addUserBank($param);
if($result)
$status='success';
else
$status = 'failed';
return redirect('member/profile/setting/account')->with('status',$status);
}
Run Code Online (Sandbox Code Playgroud)
我的服务是这样的:
public function addUserBank($param)
{
$instance = User::where('id', '=', auth()->user()->id)->first();
$param['user_id'] = auth()->user()->id;
$param['status'] = 0;
$instance->banks()->attach([
'status' => $param['status'],
'account_name' => $param['account_name'],
'account_number' => $param['account_number'],
'branch' => $param['branch']
]);
return $result;
}
Run Code Online (Sandbox Code Playgroud)
我的模型用户是这样的:
<?php
namespace App;
use App\Models\MasterData;
use Collective\Html\Eloquent\FormAccessible;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
use Notifiable, FormAccessible;
protected $fillable …Run Code Online (Sandbox Code Playgroud) 我的代码是这样的:
<div style="width: 300px;">
<table width="100%" border="2px solid blue">
<tr>
<td style="width:30%">Player</td>
<td style="width:30%">Club</td>
<td style="width:30%">Country</td>
</tr>
<tr>
<td style="width:30%">HazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazardHazard</td>
<td style="width:30%">Chelsea</td>
<td style="width:30%">Belgium</td>
</tr>
<tr>
<td>Ronaldo</td>
<td>Real Madrid</td>
<td>Portugal</td>
</tr>
<tr>
<td>Messi</td>
<td>Barcelona</td>
<td>Argentina</td>
</tr>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
结果是这样的:
我试图在列中添加width = 30%player,但它仍然不起作用.
我的脚本javascript是这样的:
email: {
required: true,
email: true
},
Run Code Online (Sandbox Code Playgroud)
在文本字段中的电子邮件中,我写了:chelsea@gmail没有.com,它是有效的。
有什么解决方案可以解决我的问题吗?
谢谢
我在http://windows.php.net/download下载VC14 x64 Non Thread Safe(2017年1月18日21:06:20)
然后我提取它
看看结果:
似乎没有php.ini文件
我找到了哪里?
我的脚本是这样的:
===========================================----- ===================
<template>
<v-card
max-width="1200"
class="mx-auto"
>
<v-container
class="pa-2"
fluid
>
<v-row>
<v-col
v-for="(item, i) in items"
:key="i"
>
<v-card
:color="item.color"
dark
>
<v-list-item three-line>
<v-list-item-avatar
size="125"
tile
>
<v-img :src="item.src"></v-img>
</v-list-item-avatar>
<v-list-item-content class="align-self-start">
<v-list-item-title
class="headline mb-2"
v-text="item.title"
></v-list-item-title>
<v-list-item-subtitle v-text="item.artist"></v-list-item-subtitle>
<v-list-item-subtitle v-text="item.artist"></v-list-item-subtitle>
</v-list-item-content>
<v-list-item-content class="align-self-start">
<v-list-item-title
class="headline mb-2"
v-text="'right align'"
></v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-card>
</v-col>
</v-row>
</v-container>
</v-card>
</template>
<script>
export default {
data: () => ({
items: [
{
color: '#1F7087',
src: 'https://cdn.vuetifyjs.com/images/cards/foster.jpg',
title: 'Supermodel',
artist: 'Foster …Run Code Online (Sandbox Code Playgroud) 我已经设置了默认值it ,nuxt.config.js如下所示:
但如果我访问本地主机,它会重定向到:http://localhost:3000/en
它应该重定向到http://localhost:3000/
我怎么解决这个问题?
我的vue组件,你可以在下面看到
<template>
<div>
...
<select class="form-control" v-model="selected" @change="myFunction()">
<option selected disabled>Status</option>
<option v-for="status in orderStatus" v-bind:value="status.id">{{ status.name }}</option>
</select>
...
</div>
</template>
<script>
export default {
data() {
return{
selected: ''
}
},
methods: {
myFunction: function() {
console.log(this.selected)
}
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
关于gulp存在的错误
Vue模板语法错误:
:使用v-model时,将忽略内联选定的属性.而是在组件的数据选项中声明初始值.
我该如何解决?
我的html代码是这样的:
<form>
<label for="name">* Name</label>
<input type="text" id="name" required><br>
<label for="name">* Address</label>
<input type="text" id="address" required><br>
<input type="submit" value="Submit">
</form>
Run Code Online (Sandbox Code Playgroud)
我正在使用requiredHTML5 属性来验证字段。
如果用户不输入文本,则会显示 HTML5 错误。
如果任何必填字段留空,我想禁用提交按钮。
我该怎么做?
html ×3
javascript ×3
jquery ×3
vue.js ×3
php ×2
css ×1
google-maps ×1
laravel ×1
laravel-5.3 ×1
mysql ×1
nuxt-i18n ×1
nuxt.js ×1
object ×1
pivot-table ×1
vuejs2 ×1
vuetify.js ×1
vuex ×1