小编Ham*_*ter的帖子

svg 边框角与内边框

我有一些块,有一些设计:

在此输入图像描述

我有一些 svg 代码:

.box {
	position: relative;
	margin: .75em auto 0;
	max-width: 255px;
	min-height: 56px;
}

svg {
	position: absolute;
	width: 100%; height: 100%;
}
Run Code Online (Sandbox Code Playgroud)
<div class='box'>
	<svg>
		<mask id='m' fill='#fff'>
			<rect id='r' width='256' height='56'/>
			<circle id='c' r='10' fill='#000'/>
			<use xlink:href='#c' x='100%'/>
			<use xlink:href='#c' y='100%'/>
			<use xlink:href='#c' x='100%' y='100%'/>
		</mask>
		
		<mask id='m2' fill='#fff'>
			<rect id='r2' width='248' height='50' x="4" y="4" />
			<circle id='c2' r='14' fill='#000' stroke='#000'/>
			<use xlink:href='#c2' x='100%' />
			<use xlink:href='#c2' y='100%'/>
			<use xlink:href='#c2' x='100%' y='100%'/>
		</mask>
		
		<use xlink:href='#r' …
Run Code Online (Sandbox Code Playgroud)

html css svg css-shapes

3
推荐指数
2
解决办法
756
查看次数

Bootstrap 4 + 同位素

我有一个简单的项目。我将同位素用于砌体网格和 Bootstrap 4 ( flex):

$(window).on('load', function(){

    function gridMasonry(){
        var grid = $(".grid")
        if( grid.length ){
            
          grid.isotope({
            itemSelector: '.grid-item',
            percentPosition: true,
            layoutMode: 'masonry',
            masonry: {
              //columnWidth: '.grid-sizer'
            }
          });
            
        }
    }
    gridMasonry();
});
Run Code Online (Sandbox Code Playgroud)
.grid-item img {
  height: 192px;
  width: 100%;
  
  object-fit:cover;
}

.y-2.grid-item img {
  height: 400px;
  width: 100%;
}

.grid-item {
  margin-bottom: 16px;
}
Run Code Online (Sandbox Code Playgroud)
<script src="https://code.jquery.com/jquery-3.1.0.js"></script>
  
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" >
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js"></script>
  
  
  <div class="container">
    <div class="row grid">
      <div class="col-sm-3 grid-item y-2">
        <img src="https://dummyimage.com/400x900/000/fff&text=img" alt="" class="img-fluid">
      </div>
      <div class="col-sm-3 …
Run Code Online (Sandbox Code Playgroud)

jquery jquery-isotope bootstrap-4

3
推荐指数
1
解决办法
3717
查看次数

谷歌地图标记悬停效果

我有一些带有标记的谷歌地图:

var locations = [
  {
    'name'    : 'Location 1',
    'adress'  : '215 West Girard Avenue 19123',
    'location':{
      'lat' : 39.9695601,
      'lon' : -75.1395161
    },
    'lable'   : '200',
    'prev'    : 'https://images.unsplash.com/photo-1489706920962-640fcad4b463?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=057570f4673903ff39658ee6ac17a66a&auto=format&fit=crop&w=600&q=60',
  },
  {
    'name'    : 'Location 2',
    'adress'  : '5360 Old York Road 19141',
    'location':{
      'lat' : 40.034038,
      'lon' : -75.145223
    },
    'lable'   : '30',
    'prev'    : 'https://images.unsplash.com/photo-1483519396903-1ef292f4974a?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=594ae239b7e8e8ed17d447a9950adeb4&auto=format&fit=crop&w=600&q=60',
  },
  {
    'name'    : 'Location 3',
    'adress'  : '1350 W Girard Avenue 19123',
    'location':{
      'lat' : 39.9713524,
      'lon' : -75.1590360
    },
    'lable' …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps google-maps-api-3

0
推荐指数
1
解决办法
2849
查看次数

在脚本中使用 vue-i18n

我有一个简单的项目代码和框

我使用/vue-i18n

你好世界模板:

<h1>{{msg}}</h1>
Run Code Online (Sandbox Code Playgroud)

脚本

data() {
    return {
      msg: `{{ $t("welcomeMsg") }}`
    }
  }
Run Code Online (Sandbox Code Playgroud)

插件/i18n.js :

const messages = {
  en: {
    welcomeMsg: "Welcome to Your Vue.js App",
  },
  es: {
    welcomeMsg: "Bienvenido a tu aplicación Vue.js",
  }
};
Run Code Online (Sandbox Code Playgroud)

问题:如何从msg:{{ $t("welcomeMsg") }}这样的脚本中使用 vue-i18n ?

PS: this.$t("welcomeMsg")这是工作,但没有翻译!

vue.js vue-i18n

0
推荐指数
2
解决办法
3743
查看次数