小编aMJ*_*Jay的帖子

当我选择第二个输入框时,为什么音译不起作用?

<div class="row" v-for="(book, index) in Subsequent" :key="index">
    <div class="col-md-8">
        <div class="form-group label-floating">
            <label class="control-label"> Details</label>
            <input type="text" class="form-control" v-model="book.seizuredetails" id="transliterateTextarea2">
        </div>
    </div>
</div>
<a @click="addNewRow">Add Another</a>
</div>
Run Code Online (Sandbox Code Playgroud)

我在第一个输入框中得到音译.(第一种情况没问题)

因此,当我在添加另一个时,我能够有一个新的输入框.但是,音译不起作用.

我的音译脚本是

  <script type="text/javascript">

      // Load the Google Transliterate API
      google.load("elements", "1", {
          packages: "transliteration"
      });

      function onLoad() {
          var options = {
              sourceLanguage: google.elements.transliteration.LanguageCode.ENGLISH,
              destinationLanguage: [google.elements.transliteration.LanguageCode.MALAYALAM],
              shortcutKey: 'ctrl+g',
              transliterationEnabled: true
          };

          // Create an instance on TransliterationControl with the required
          // options.
          var control = new google.elements.transliteration.TransliterationControl(options);

          // Enable transliteration in …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery vue.js

10
推荐指数
1
解决办法
213
查看次数

JavaScript中的“调用堆栈”与“执行上下文堆栈”相同吗?

我经常在许多文章中看到“调用堆栈”。像这样:https : //hackernoon.com/understanding-js-the-event-loop-959beae3ac40#ec22

在此处输入图片说明

但是在ECMAScript文档中找不到“调用堆栈”。
“调用堆栈”与“ 执行上下文堆栈 ”相同吗?

在此处输入图片说明

javascript

7
推荐指数
1
解决办法
139
查看次数

如何使用环境变量注入故事书

{
    "main": "index.js",
    "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1",
        "storybook": "start-storybook -p 9001 -c .storybook ",
    },
    "dependencies": {
        ...
    },
    "devDependencies": {
        "@sambego/storybook-styles": "^1.0.0",
        "@storybook/addon-actions": "^4.1.7",
        "@storybook/addon-info": "^4.1.7",
        "@storybook/addon-knobs": "^4.1.7",
        "@storybook/addon-links": "^4.1.7",
        "@storybook/addon-notes": "^4.1.7",
        "@storybook/addon-viewport": "^4.1.7",
        "@storybook/addons": "^4.1.7",
        "@storybook/react": "^4.1.7",
        "autoprefixer": "7.1.1",
        "babel-core": "^6.26.3",
        "babel-eslint": "7.2.3",
        "babel-loader": "^7.1.1",
        "babel-plugin-transform-decorators-legacy": "^1.3.5",
        "babel-plugin-transform-runtime": "^6.23.0",
        "babel-preset-env": "^1.6.0",
        "babel-preset-react-app": "^3.0.2",
        "clean-webpack-plugin": "^0.1.16",
        "copy-webpack-plugin": "^4.3.1",
        "css-loader": "^0.28.0",
        "eslint": "4.10.0",
        "eslint-config-react-app": "^2.0.1",
        "eslint-loader": "1.9.0",
        "eslint-plugin-flowtype": "2.39.1",
        "eslint-plugin-import": "2.8.0",
        "eslint-plugin-jsx-a11y": "5.1.1", …
Run Code Online (Sandbox Code Playgroud)

variables environment storybook

6
推荐指数
1
解决办法
1万
查看次数

res/drawable内的Android子目录

我正在创建一个与扑克游戏密切相关的 android 项目,但这是一个离线项目,我必须在 res/drawable 文件夹中添加所有 52 张卡片,这与所有其他图像和 xml 变得非常混乱。

例如

res/drawable
Spade
spade_ace.png
spade_two.png
Hearts
hearts_ace.png
hearts_two.png
Run Code Online (Sandbox Code Playgroud)

我确实参考了这个链接,但我找不到任何合适的解决方案,有什么办法可以通过创建子目录来组织它,或者有没有其他可能的方法

android android-resources android-drawable

5
推荐指数
0
解决办法
63
查看次数

位于两个文本块之间的图像外部的形状

我想要在两个文本块之间有一个图像,并将所有这些都居中。图像应该具有shape-outside允许文本以圆形形状溢出的属性,如下所示:

在此输入图像描述

在哪里:

  • 红色块=文本
  • 黑色圆圈=图像

我当前的代码用于flex将整个内容居中,但事实证明shape-outside不起作用。

div{
  display:flex;
  flex-flow:row nowrap;
}
img{float:left;
shape-outside:circle(100px at 50%);
width:200px;height:200px;}
p{width:600px;}
Run Code Online (Sandbox Code Playgroud)
<div>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex sapiente iste repudiandae aspernatur, illum esse veniam eligendi, dolor consequuntur iure, cumque laudantium quidem ratione perferendis minima dignissimos debitis! Sed, placeat.Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ex sapiente iste repudiandae aspernatur, illum esse veniam eligendi, dolor consequuntur iure, cumque laudantium quidem ratione perferendis minima dignissimos …
Run Code Online (Sandbox Code Playgroud)

css css-shapes

5
推荐指数
1
解决办法
526
查看次数

在Woocommerce中的WP_Query循环中显示产品价格

我有这段代码来显示某个类别的产品,我也想显示它的价格。有什么想法可以添加或更改吗?下面的代码不显示任何内容(也没有错误)。

<?php

$product_categories = array('cat-name');

$wc_query = new WP_Query( array(
    'post_type' => 'product',
    'post_status' => 'publish',
    'posts_per_page' => 10,
    'tax_query' => array( array(
        'taxonomy' => 'product_cat',
        'field'    => 'slug',
        'terms'    => $product_categories,
        'operator' => 'IN',
    ) )
) );
?>
<h1 style="margin-top:30px;">Cat Name</h1>
<div class="changing-img">
     <?php if ($wc_query->have_posts()) : ?>
     <?php while ($wc_query->have_posts()) :
                $wc_query->the_post(); ?>
<a href="<?php the_permalink(); ?>">
          <?php the_post_thumbnail('full'); ?>
          <?php the_post_thumbnail('full'); ?>
          <h6><?php the_title(); ?> </h6>
          <p><?php echo $wc_query->get_price_html(get_the_ID()); ?></p>
</a>
     <?php endwhile; ?>
     <?php wp_reset_postdata(); …
Run Code Online (Sandbox Code Playgroud)

php wordpress product woocommerce price

4
推荐指数
1
解决办法
5936
查看次数

带有 Bootstrap 4 的数据表看起来很乱

当尝试在 Bootstrap 4 中使用数据表时,它看起来不太好。我尝试按照 Datatables 站点上的基本示例进行操作,但它看起来仍然如此(请参见下面的屏幕截图)。

我正在链接到 Datatables 在其自定义页面上提供的文件。这是我的 html 文件的标题

<head>
    <meta charset="utf-8">
    <script type="text/javascript" src="https://cdn.datatables.net/v/bs4-4.0.0/jq-3.2.1/dt-1.10.16/datatables.min.js"></script>
    <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4-4.0.0/jq-3.2.1/dt-1.10.16/datatables.min.css"/>
    <title>Report</title>
    <style>
        body {
            padding-top: 20px;
        }
    </style>
</head>
Run Code Online (Sandbox Code Playgroud)

有没有其他人遇到或看到过这个问题?

谢谢

带有 Bootstrap 4 的数据表外观的屏幕截图:

在此处输入图片说明

css datatables bootstrap-4

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

Flutter 错误:“_Smi”类型不是“double”类型的子类型

我使用 flutter 1.0 开发了一个应用程序。该应用程序在大多数 android 和 ios 手机上运行良好。但是我发现有一部 android 手机和一部 iphone 无法打开该应用程序,只显示错误消息“类型 '_Smi' 不是类型 'double' 的子类型”。有没有人可以告诉我我的应用程序上发生了什么。

打开flutter app时报错图片:

在此处输入图片说明

flutter

2
推荐指数
1
解决办法
3014
查看次数

checkValidity 函数未检测到“tel”类型的无效输入

我正在尝试使用这样的 checkValidity 函数验证表单的输入

    let inputs = document.getElementsByTagName('input');
    inputs = Object.values(inputs);
    let textarea = document.getElementsByTagName('textarea');
    textarea = Object.values(textarea);
    inputs.push(textarea[0]);
    
    for(let i=0;i<inputs.length;i++){
    	inputs[i].addEventListener('keyup', function(){
    
    for(let i = 0;i<inputs.length;i++){
        inputs[i].addEventListener('change', function(){
          if($(inputs)[i].checkValidity()){
          $(inputs)[i].classList.remove('inputInvalid');
          $(inputs)[i].classList.add('inputValid');
        }else{
          $(inputs)[i].classList.remove('inputValid');
          $(inputs)[i].classList.add('inputInvalid');
        }
        })
      }
    
      });
    }
Run Code Online (Sandbox Code Playgroud)
input.inputValid, textarea.inputValid{
  border-color:green;
}
input.inputInvalid, textarea.inputInvalid{
  border-color:red;
}

div{
  margin:10px 
}
Run Code Online (Sandbox Code Playgroud)
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div>
  <span>Name*</span>
    <input required type="text" size="40" class="text"/>
  </div>
  <div>
  <span>Company Name</span>
    <input type="text" size="40" class="text" />
  </div>
  <div>
    <span>Telephone*</span>
    <input required type="tel"  size="40" class="text" />
  </div>
  <div>
  <span>e-mail*</span> …
Run Code Online (Sandbox Code Playgroud)

html javascript forms validation jquery

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

从文件中删除所有行,以特定字符串开头和结尾

我需要检查文件是否包含特定的两个字符串,如果包含,则删除它们之间的所有文本(包括字符串)。假设我有一个text看起来像这样的文件:

line of text
line of text
line of text
line of text
#1st string
line of text
line of text
line of text
#2nd string
Run Code Online (Sandbox Code Playgroud)

现在我想删除#1st string#2nd string和这两个字符串之间的所有行。

我尝试将整个文本放入一个变量中,然后像这样删除它们:

line of text
line of text
line of text
line of text
#1st string
line of text
line of text
line of text
#2nd string
Run Code Online (Sandbox Code Playgroud)

不幸的是,这不起作用,因为文本文件包含一些命令,它们以某种方式列出当前目录的内容并将输出混合到变量中,从而使文件损坏。我可以以某种方式防止这种情况发生,还是有更好的方法来完全实现这一目标?

linux bash

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