小编Kim*_* Vu的帖子

InstantSearch 无法删除蓝色十字,这会重置查询

我正在使用 algolia 的 InstantSearch 创建一个输入字段,但我在调试这个交叉的来源时遇到了麻烦。当输入字段获得焦点或悬停时,会出现蓝色十字,看起来像是清除了查询。(我已经有一个用于重置的按钮)。检查元素在悬停/聚焦时不会显示任何“弹出”内容,我想知道它是如何到达那里的

\n

有什么我跳过的吗?或者在CSS中添加额外的内容?在实施之前我可能已经使用了一个模板

\n

在此输入图像描述

\n

我的html:

\n
  <div className="items-center h-full">\n        <InstantSearch\n          indexName={variables.ALGOLIA_INDEX}\n          searchClient={algolia}\n        >\n          <div className="h-full flex flex-col items-center justify-center">\n            <SearchBox\n              translations={{\n                placeholder: \'\',\n                resetTitle: \'T\xc3\xb8m s\xc3\xb8kefeltet\',\n              }}\n              reset={\n                <SearchCloseIcon className=" h-5 md:h-10 transform duration-500 hover:scale-110 cursor-pointer" />\n              }\n              autoFocus={true}\n            />\n            <Results />\n          </div>\n        </InstantSearch>\n      </div>\n
Run Code Online (Sandbox Code Playgroud)\n

我的CSS:

\n
.ais-SearchBox {\n}\n\n.ais-SearchBox-form {\n  display: flex;\n}\n.ais-Pagination {\n  margin-top: 1em;\n}\n.ais-SearchBox-resetIcon {\n  height: 2rem;\n  width: 2rem;\n}\n.left-panel {\n  float: left;\n  width: 250px;\n}\n\n.right-panel {\n  margin-left: 260px;\n}\n\n.ais-InstantSearch {\n  max-width: 960px;\n  overflow: hidden;\n  margin: …
Run Code Online (Sandbox Code Playgroud)

reactjs algolia instantsearch tailwind-css

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

ImageButton更改src

更改ImageButton src

这是标签的xml:

    <ImageButton
        android:layout_width="0dp"
        android:id="@+id/infobutton"
        android:layout_weight="1"
        android:src="@drawable/edit"
        android:scaleType="fitCenter"
        android:layout_height="60dp" />
Run Code Online (Sandbox Code Playgroud)

这就是我按下按钮时对按钮做的事情

        button.setBackgroundResource(R.drawable.save);
Run Code Online (Sandbox Code Playgroud)

按下之前的ImageButton

在此输入图像描述

按下后的图像:

在此输入图像描述

我希望按钮只有保存图片和它适合fitCenter,为什么其他src没有被新的src取代?

android imagebutton

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

vuejs 中的 __webpack_public_path__

我无法让webpack_public_path与我的 vue 应用程序一起使用。我收到这个错误:

Module Error (from ./node_modules/eslint-loader/index.js):
error: '__webpack_public_path__' is not defined (no-undef) at src\publicpath.js:1:1:
> 1 | __webpack_public_path__ = process.env.VUE_APP_CHAT_URL;
    | ^
  2 |
Run Code Online (Sandbox Code Playgroud)

我是这样实现的:

//publicpath.js
__webpack_public_path__ = process.env.VUE_APP_CHAT_URL;
Run Code Online (Sandbox Code Playgroud)

//main.js
import './publicpath'
import Vue from 'vue'
import App from './App.vue'
import store from './store/index'

Vue.config.productionTip = false;

new Vue({
  render: h => h(App),
  store
}).$mount('#tn-chat')
Run Code Online (Sandbox Code Playgroud)

我遗漏了什么重要的东西吗?

webpack vue.js

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

元素隐式具有“any”类型,因为“string”类型的表达式不能用于索引类型“Palette”

我越来越

Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'Palette'.
  No index signature with a parameter of type 'string' was found on type 'Palette'.ts(7053)
Run Code Online (Sandbox Code Playgroud)

尝试使用字符串列表从ThemeProviderMaterial-UI获取主题时

样本是 astring[]并且包含看起来像"primary.light"or的字符串"secondary.dark"

在此输入图像描述

useTheme使用这个文件:

import { createTheme, responsiveFontSizes } from '@mui/material/styles';
    import { deepPurple, amber } from '@mui/material/colors';
    
    // Create a theme instance.
    let theme = createTheme({
      palette: {
        primary: deepPurple,
        secondary: amber,
      },
    });
    
    theme = responsiveFontSizes(theme);
    
    export …
Run Code Online (Sandbox Code Playgroud)

typescript reactjs material-ui

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