  The gamma-ray burst GRB 211211A and its associated kilonova-like emission
were reported recently. A significant difference between this association event
and GRB 170817A/AT 2017gfo is that GRB 211211A has a very long duration. In
this paper, we show that this association event may arise from a neutron
star$-$white dwarf (NS$-$WD) merger if a magnetar leaves finally in the central
engine. Within the NS$-$WD merger, the main burst of GRB 211211A could be
produced by magnetic bubble eruptions from toroidal magnetic field
amplification of the pre-merger NS. This toroidal field amplification can be
induced by the runaway accretion from the WD debris disc if the disc is in low
initial entropy and efficient wind. While the extended emission of GRB 211211A
is likely involved with magnetic propelling. The observed energetics and
duration of the prompt emission of GRB 211211A can be fulfilled in comparison
with those of accretion in hydrodynamical thermonuclear simulation, as long as
the WD has a mass $\gtrsim1M_{\odot}$. Moreover, if the X-ray plateau in GRB
afterglows is due to the magnetar spin-down radiation, GRB optical afterglows
and kilonova-like emission can be well jointly modeled combining the standard
forward shock with the radioactive decay power of $^{56}{\rm Ni}$ adding a
rotational power input from the post-merger magnetar.
