代码中没有错误,但是在对话框元素中,您需要收听oncancel
事件,而不是onclose
事件。
ReactDOM.render(
<App />,
document.getElementById("root")
);
function App() {
const modalRef = React.createRef()
function handleClose(e) { // press escape button to trigger this
e.preventDefault()
console.log('closing')
}
return(
<React.Fragment>
<button
onClick={() => modalRef.current.showModal()}>
Open modal
</button>
<dialog
ref={modalRef}
onCancel={handleClose}>
Hello world
</dialog>
</React.Fragment>
)
}
您可以做这样的事情:
- 删除
最小值
并添加max-height:100VH;
on.modal
。 - 添加
最大高调:calc(100VH -80px)
(80px是按钮 +桨板 +呼吸模态的更多空间)和溢出:auto
在模态上身体(我假设的第一个Div)。
<div id="modal">
<div class="modal">
<div class="modal-body">
body<br>body<br>body<br>body<br>body<br>body<br>body<br>body<br>body<br>body
</div>
<div class="modal-actions">
actions
</div>
</div>
</div>
#modal{
position:absolute;
z-index:1;
top:0;
left:0;
bottom:0;
right:0;
display:flex;
background:red;
}
.modal{
margin:auto;
padding:20px;
width:200px;
display:flex;
flex-flow:column wrap;
justify-content:space-between;
align-items:stretch;
background:#fff;
max-height: 100vh;
}
.modal-body {
max-height: calc(100vh - 80px);
overflow: auto;
}
.modal-actions{
padding-top:10px;
text-align:right;
background:yellow;
}
您可以使用 flex 。
实时代码: codepen html
html:
<div class='alert'>
<span class='alert-icon'>icon</span>
<div class='alert-content'>
<div>text</div>
<div>text</div>
<div>text</div>
</div>
<span class='alert-close-icon'> close icon </span>
</div>
css:
.alert {
background-color: red;
color:#fff;
display: flex;
align-items: center;
justify-content: space-between;
width: 250px;
border-radius: 6px;
padding: 10px 10px
}
只需添加图像,然后将图像替换为<代码> .Alert-icon .Alert-close-icon
您对 bcustomer 表的最后一个插入件是
insert into bcustomer (item_id, customer_id, quan, price) values (4, 12, 19, 13);
customer中没有任何匹配的 last_order_id 。
如果您将运行
insert into bcustomer (item_id, customer_id, quan, price) values (4, 1, 19, 13);
customer_id = 1 ,它将更新您的 customer 表,因为它具有匹配的ID,即 1 。
尝试此
var testarray = newbody.split('&gt;');
// TypeError:无法读取未定义的属性“拆分”
newbody
的属性'split'的属性 undefined
。因此,引擎无法读取未定义
的属性“拆分”。仅字符串
S具有split
属性。
为什么未定义
?
var newbody = partsarray [1];
因为partsarray
没有两个元素。如果partsarray
是[0]
而不是[0,1]
,那么它没有第二个元素[1]
访问。
为什么partarray
有两个元素?
var partsarray = thebody.split('&lt;');
可能是因为中没有
&lt;
。
请查看您使用的代码顺序
_product.push_back(new Wet(Pquantity, Pprice ,Pcode, Pname, Mname, Madd, Mcont));
...
class Wet : public Product
{
public:
Wet(int pQuan, double pPrice, int pCode, string pName, string mName, string mAdd, string mCon) : Product(pQuan, pPrice, pCode, pName, mName, mAdd, mCon){}
};
在定义它们之前, 。这就是为什么编译器不认识它们的原因。
要解决,您将必须将product的定义:: edit
从product
类中移出,然后将其放在代码中的某个地方,以便在声明编译器已经看到了湿和
干燥
。
导入存储为命名导入(您将其导出为命名导出)
import { Store } from "../src/components/context/Points";
我在listView.builder作为自动完成小部件的一部分中遇到了同样的滚动问题。我发现确保通话以某种方式与滚动相冲突,因此我评论了。因为当您要使用键盘的向上和下键时,需要它,而我在应用中不需要它。希望这可以帮助您缩小错误。
if (highlight) {
SchedulerBinding.instance
.addPostFrameCallback((Duration timeStamp) {
Scrollable.ensureVisible(context, alignment: 0.5);
});
}
看来您正在尝试访问数据库
类上不存在的属性itemclass
。您确实在中访问itemclass
属性语句。
也许取代
Database.itemClass += 1;
会有所
instance.items.allItems[i].itemClass += 1;
帮助?
然后,您实际上是在使用数据库
类的当前实例
,并且能够从中访问item
itemdatabase 。
您尝试使用database.itemclass
进行操作的方式只有在您具有itemClass
database
类中静态定义的情况下才能使用。您需要数据库
类的实际实例才能访问您的itemDatabase
。 (请参阅静态类上的Microsoft的文档在这里)
我们可以使用tidyr :: axtim_rows
的默认值将单位
序列拆分为每个单独的行,然后加入两个表。由于公寓
该变量的版本是整数,因此我使用convert = true
来让tidyr
猜测预期的输出格式,它确实正确在这种情况下。如果没有,我们可以添加一个突变(单位= as.integer(umit))%&gt;%
行。
library(dplyr)
apartment_long <- apartment %>% tidyr::separate_rows(units, convert = TRUE)
participant %>% left_join(apartment_long, by = c("Apartmentvisits" = "units"))
结果
A tibble: 1,011 × 3
participantId Apartmentvisits region
<dbl> <int> <chr>
1 0 786 NA
2 1 1093 North-west
3 2 949 NA
4 3 827 NA
5 4 963 NA
6 5 997 NA
7 6 1220 NA
8 7 1118 NA
9 8 1174 NA
10 9 860 NA
# … with 1,001 more rows
请检查下面的代码,
public class RippleBackground extends RelativeLayout{
private static final int DEFAULT_RIPPLE_COUNT=6;
private static final int DEFAULT_DURATION_TIME=3000;
private static final float DEFAULT_SCALE=6.0f;
private static final int DEFAULT_FILL_TYPE=0;
private int rippleColor;
private float rippleStrokeWidth;
private float rippleRadius;
private int rippleDurationTime;
private int rippleAmount;
private int rippleDelay;
private float rippleScale;
private int rippleType;
private Paint paint;
private boolean animationRunning=false;
private AnimatorSet animatorSet;
private ArrayList<Animator> animatorList;
private LayoutParams rippleParams;
private ArrayList<RippleView> rippleViewList=new ArrayList<RippleView>();
public RippleBackground(Context context) {
super(context);
}
public RippleBackground(Context context, AttributeSet attrs) {
super(context, attrs);
init(context, attrs);
}
public RippleBackground(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init(context, attrs);
}
private void init(final Context context, final AttributeSet attrs) {
if (isInEditMode())
return;
if (null == attrs) {
throw new IllegalArgumentException("Attributes should be provided to this view,");
}
final TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.RippleBackground);
rippleColor=typedArray.getColor(R.styleable.RippleBackground_rb_color, getResources().getColor(R.color.rippelColor));
rippleStrokeWidth=typedArray.getDimension(R.styleable.RippleBackground_rb_strokeWidth, getResources().getDimension(R.dimen.rippleStrokeWidth));
rippleRadius=typedArray.getDimension(R.styleable.RippleBackground_rb_radius,getResources().getDimension(R.dimen.rippleRadius));
rippleDurationTime=typedArray.getInt(R.styleable.RippleBackground_rb_duration,DEFAULT_DURATION_TIME);
rippleAmount=typedArray.getInt(R.styleable.RippleBackground_rb_rippleAmount,DEFAULT_RIPPLE_COUNT);
rippleScale=typedArray.getFloat(R.styleable.RippleBackground_rb_scale,DEFAULT_SCALE);
rippleType=typedArray.getInt(R.styleable.RippleBackground_rb_type,DEFAULT_FILL_TYPE);
typedArray.recycle();
rippleDelay=rippleDurationTime/rippleAmount;
paint = new Paint();
paint.setAntiAlias(true);
if(rippleType==DEFAULT_FILL_TYPE){
rippleStrokeWidth=0;
paint.setStyle(Paint.Style.FILL);
}else
paint.setStyle(Paint.Style.STROKE);
paint.setColor(rippleColor);
rippleParams=new LayoutParams((int)(2*(rippleRadius+rippleStrokeWidth)),(int)(2*(rippleRadius+rippleStrokeWidth)));
rippleParams.addRule(CENTER_IN_PARENT, TRUE);
animatorSet = new AnimatorSet();
animatorSet.setInterpolator(new AccelerateDecelerateInterpolator());
animatorList=new ArrayList<Animator>();
for(int i=0;i<rippleAmount;i++){
RippleView rippleView=new RippleView(getContext());
addView(rippleView,rippleParams);
rippleViewList.add(rippleView);
final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(rippleView, "ScaleX", 1.0f, rippleScale);
scaleXAnimator.setRepeatCount(ObjectAnimator.INFINITE);
scaleXAnimator.setRepeatMode(ObjectAnimator.RESTART);
scaleXAnimator.setStartDelay(i * rippleDelay);
scaleXAnimator.setDuration(rippleDurationTime);
animatorList.add(scaleXAnimator);
final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(rippleView, "ScaleY", 1.0f, rippleScale);
scaleYAnimator.setRepeatCount(ObjectAnimator.INFINITE);
scaleYAnimator.setRepeatMode(ObjectAnimator.RESTART);
scaleYAnimator.setStartDelay(i * rippleDelay);
scaleYAnimator.setDuration(rippleDurationTime);
animatorList.add(scaleYAnimator);
final ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(rippleView, "Alpha", 1.0f, 0f);
alphaAnimator.setRepeatCount(ObjectAnimator.INFINITE);
alphaAnimator.setRepeatMode(ObjectAnimator.RESTART);
alphaAnimator.setStartDelay(i * rippleDelay);
alphaAnimator.setDuration(rippleDurationTime);
animatorList.add(alphaAnimator);
}
animatorSet.playTogether(animatorList);
}
private class RippleView extends View{
public RippleView(Context context) {
super(context);
this.setVisibility(View.INVISIBLE);
}
@Override
protected void onDraw(Canvas canvas) {
int radius=(Math.min(getWidth(),getHeight()))/2;
canvas.drawCircle(radius,radius,radius-rippleStrokeWidth,paint);
}
}
public void startRippleAnimation(){
if(!isRippleAnimationRunning()){
for(RippleView rippleView:rippleViewList){
rippleView.setVisibility(VISIBLE);
}
animatorSet.start();
animationRunning=true;
}
}
public void stopRippleAnimation(){
if(isRippleAnimationRunning()){
animatorSet.end();
animationRunning=false;
}
}
public boolean isRippleAnimationRunning(){
return animationRunning;
}
}
在attr.xml文件中添加此添加,
<declare-styleable name="RippleBackground">
<attr name="rb_color" format="color" />
<attr name="rb_strokeWidth" format="dimension"/>
<attr name="rb_radius" format="dimension"/>
<attr name="rb_duration" format="integer"/>
<attr name="rb_rippleAmount" format="integer"/>
<attr name="rb_scale" format="float"/>
<attr name="rb_type" format="enum">
<enum name="fillRipple" value="0"/>
<enum name="strokeRipple" value="1"/>
</attr>
</declare-styleable>
在color.xml文件中添加color.xml文件
<color name="rippelColor">#0099CC</color>
添加dimen.xml文件
<dimen name="rippleStrokeWidth">2dp</dimen>
<dimen name="rippleRadius">64dp</dimen>
之后,添加上述代码后,只需在您的活动中启动动画
rippleBackground.startRippleAnimation();
这是Tomcat 10上的一个常见问题,因为从Java EE到Jakarta EE的更改,因此您可以使用Jakarta EE 9更改项目
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>9.0.0</version>
<scope>provided</scope>
</dependency>
并导入此软件包
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
,如果您不想这样做,则可以降级到Tomcat 9。
有关相关文档,请参见以下链接
流中发生了许多转换:
Project -> ProjectRelease -> Release -> Track -> Resource -> Track -> Release
它们正在沿不同的“方向”进行,这不是很直观。
您可以引入一种负责检查特定版本的任何资源 resource 属于给定的 country 。
如果我正确理解您的逻辑,可以像这样写:
public static List<Release> getReleasesByCountry(Project project,
String countryName) {
return project.getProjectReleases().stream()
.map(ProjectRelease::getRelease)
.filter(resource -> hasResourceByCountry(resource, countryName))
.collect(Collectors.toList());
}
public static boolean hasResourceByCountry(Release release,
String countryName) {
return release.getTracks().stream()
.map(Track::getResource)
.anyMapth(resource -> countryName.equals(resource.getCountry()));
}
错误的原因
看起来您有一个错字,这可能是
Looks like you have a typo which might be the cause of the error
should be
声明:未找到或未唯一的标识符。 line5这是我尝试多次编写代码但未解决我的错误的错误