小编Wil*_*iam的帖子

Angular 2三元,如果要为输入添加禁用

如果满足条件,我disabled该如何添加input

我今天拥有的: <input class="previous" [attr.disabled] = "active === 1 ? 'disabled' : ''">

但这增加了disabled="disabled",我只想要disabled.

所以我需要的是:<input class="previous" disabled>如果满足条件.

ternary-operator angular

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

如何在 WordPress 中显示查看次数最多的帖子?

我想使用 WP_Query 显示 WordPress 中查看次数最多的 10 个帖子,但我的代码没有显示任何内容。

代码:

$q_mostViewed = [
    'meta_key' => 'post_views_count',
    'orderby' => 'meta_value_num',
    'order' => 'DESC',
    'posts_per_page' => '10'
];
Run Code Online (Sandbox Code Playgroud)

请你帮助我好吗?


完整代码:

<!-- Most Viewed -->

    <div class="home-post-wrapper col-sm-12 nopadding">

        <?php
        $q_mostViewed = [
            'meta_key' => 'post_views_count',
            'orderby' => 'meta_value_num',
            'order' => 'DESC',
            'posts_per_page' => '10'
        ];
        $mostViewed = new WP_Query($q_mostViewed);
        if ($mostViewed->have_posts()) :
            while ($mostViewed->have_posts()) :
                $mostViewed->the_post(); ?>
                  // Do things here
            <?php endwhile; 
        endif; ?>
    </div>
Run Code Online (Sandbox Code Playgroud)

php wordpress customization filtering

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

React native + expo + Notifications = 你必须在 `app.json` 中提供 `notification.vapidPublicKey` 才能在网络上使用推送通知

我一直在 RN 上构建一个应用程序,静态内容按预期工作。现在我正在尝试添加推送通知,所有尝试都导致我出现此错误:You must provide 'notification.vapidPublicKey' in 'app.json' to use push notifications on web..

周围有几个教程,它们看起来都很简单,而且没有一个有这个错误......

所以,我已经尝试了 5 个以上的教程,使用 Node 14、react-native-web 0.11.7(由于异步问题),包括owner,slugnotification.vapidPublicKeyon app.json(最后一个不被文件接受),以及很多其他的东西,就像尝试将其用于一个全新的项目一样。

当我await Notifications.getExpoPushTokenAsync()import { Notifications } from 'expo';.

"dependencies": {
  "@expo-google-fonts/inter": "^0.1.0",
  "expo": "~37.0.3",
  "moment": "^2.27.0",
  "react": "~16.9.0",
  "react-dom": "~16.9.0",
  "react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
  "react-native-screens": "~2.2.0",
  "react-native-web": "0.11.7"
},
"devDependencies": {
  "@babel/core": "^7.8.6",
  "@types/react": "~16.9.23",
  "@types/react-native": "~0.61.17",
  "babel-preset-expo": "~8.1.0",
  "styled-components": "^5.1.1",
  "typescript": "~3.8.3"
},
Run Code Online (Sandbox Code Playgroud)

有关如何解决此错误的任何想法?

push-notification react-native expo

6
推荐指数
0
解决办法
1332
查看次数

如何获得'{element:}'值?

我有一个变量调用playerconsole.log(player);显示给我e.fn.e.init {element: undefined}e.fn.e.init {element: iframe}.

如何从此变量中选择undefined或iframe来检查if语句?

if(player != iframe) {
  //do something
}
Run Code Online (Sandbox Code Playgroud)

javascript jquery

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

语义 UI - 搜索选择不搜索

如何让语义 UI 搜索选择进行搜索?

我目前在 WordPress 中使用它,但只显示搜索字段和选项。

jQuery('#search-cursos')
  .dropdown({
    fullTextSearch: true
  });
Run Code Online (Sandbox Code Playgroud)
<link href="https://cdn.jsdelivr.net/semantic-ui/2.1.8/semantic.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/semantic-ui/2.1.8/semantic.min.js"></script>

<div class="ui fluid search selection simple dropdown">
  <input type="hidden" name="country">
  <i class="dropdown icon"></i>
  <div class="default text">Select Country</div>
  <div class="menu">
    <div class="item" data-value="ad"><i class="ad flag"></i>Andorra</div>
    <div class="item" data-value="ae"><i class="ae flag"></i>United Arab Emirates</div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

javascript wordpress search jquery semantic-ui

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

如何检查是否是时刻()

好了,我看到检查的Objectmoment我需要检查与方法moment.isMoment(obj),但是当我尝试验证moment().toDate()它告诉我,这是假的.

我如何检查对象moment是否是它.toDate()

moment.isMoment(moment()) // true
moment.isMoment(moment().toDate()) // false
Run Code Online (Sandbox Code Playgroud)

javascript angularjs momentjs

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