我需要从同一个命名空间扩展这两个类。
例如:
declare namespace myNameSpace{
class class1{
///some methods will be here
}
class class3 extends class1{
//some method wil be here
}
class class2 extends myNameSpace. class3 {
//some methods will be here
}
export namespace class2 {
//declaration will be here
}
}
Run Code Online (Sandbox Code Playgroud)
我需要扩展“myNameSpace.class1”类以及“class2”命名空间。
class newClass extends myNameSpace.class1, myNameSpace.class2 {
constructor() {
super();
}
}
Run Code Online (Sandbox Code Playgroud)
如果我调用这两个类,我会收到一条错误消息
类只能扩展一个类
有没有其他方法可以在打字稿中解决这个问题。
我有以下要素
<div class="main">
<h3> first </h3>
<div> content </div>
<h3> Second </h3>
<div> content </div>
<h3> third </h3>
<div> content </div>
</div>
Run Code Online (Sandbox Code Playgroud)
我通过css设置了第三个h3元素的边框颜色,我试过这样的
<style>
.main h3:last-child{
border : 1px solid;
}
</style>
Run Code Online (Sandbox Code Playgroud)
但它不起作用,有没有其他方法来实现我的要求